Giter VIP home page Giter VIP logo

laravel4-datatables-package's Introduction

Project is not being maintained actively.

You will most likely find a better more actively maintained fork here https://github.com/yajra/laravel-datatables

If you have issues please try and fix them and we will pull the changes if we can verify they work. That being said this project lacks automatic testing so it has become a difficult project to maintain. Please let us know if you are interested in adopting and maintaining this project, it is still pretty useful. 60% of the time, it works every time.

Datatables Bundle for Laravel 4

About

This bundle is created to handle the server-side processing of the DataTables Jquery Plugin (http://datatables.net) by using Eloquent ORM or Fluent Query Builder.

Feature Overview

  • Supporting Eloquent ORM and Fluent Query Builder
  • Adding or editing the contents of columns and removing columns
  • Templating new or current columns via Blade Template Engine
  • Customizable search in columns

Installation

Require bllim/datatables in composer.json and run composer update.

{
    "require": {
        "laravel/framework": "4.0.*",
        ...
        "bllim/datatables": "*"
    }
    ...
}

Composer will download the package. After the package is downloaded, open app/config/app.php and add the service provider and alias as below:

'providers' => array(
    ...
    'Bllim\Datatables\DatatablesServiceProvider',
),



'aliases' => array(
    ...
    'Datatables'      => 'Bllim\Datatables\Facade\Datatables',
),

Finally you need to publish a configuration file by running the following Artisan command.

$ php artisan config:publish bllim/datatables

Usage

It is very simple to use this bundle. Just create your own fluent query object or eloquent object without getting results (that means don't use get(), all() or similar methods) and give it to Datatables. You are free to use all Eloquent ORM and Fluent Query Builder features.

Some things you should know:

  • When you call the select method on Eloquent or Fluenty Query, you choose columns.
  • Modifying columns
    • You can easily edit columns by using edit_column($column, $content)
    • You can remove any column by using remove_column($column)
    • You can add columns by using `add_column($column_name, $content, $order)
    • You can use the Blade Template Engine in your $content values.
    • You may pass a function as the $content to the add_column or edit_column calls. The function receives a single parameter: the query row/model record. (see Example 2)
  • The column identifiers are set by the returned array.
    • That means, for posts.id the relevant identifier is id, and for owner.name as ownername it is ownername
  • You can set the "index" column (http://datatables.net/reference/api/row().index()) using set_index_column($name)
  • You can add class (DT_RowClass) to each row using set_row_class($content) function.
  • You can add jquery's data (DT_RowData) to each row using set_row_data($name,$content) function.
  • You can add customized search filters for each column to override the default search functionality
  • You can call make(true) to return an array of objects instead of an array of arrays. (see Example 4)

Examples

Example 1: Simple use

$posts = Post::select(array('posts.id','posts.name','posts.created_at','posts.status'));

return Datatables::of($posts)->make();

Example 2: Adding and editing columns

$place = Place::left_join('owner','places.author_id','=','owner.id')
   ->select(array('places.id','places.name','places.created_at','owner.name as ownername','places.status'));


return Datatables::of($place)
    ->add_column('operations', '<a href="{{ URL::route( \'admin.post\', array( \'edit\',$id )) }}">edit</a>
                    <a href="{{ URL::route( \'admin.post\', array( \'delete\',$id )) }}">delete</a>
                ')
    ->edit_column('status', '{{ $status ? 'Active' : 'Passive' }}')
    ->edit_column('ownername', function($row) {
        return "The author of this post is {$row->ownername}";
    })
    ->remove_column('id')
    ->make();

Notice: If you use double quotes while assigning the $content in an add_column or edit_column call, you should escape variables with a backslash (\) to prevent an error. For example:

edit_column('id', "{{ \$id }}") .

Example 3: Using filter_column

$clients = Client::select(array(
		'Client.id',
		DB::raw('CONCAT(Client.firstname," ",Client.lastname) as ClientName'),
		'Client.email',
		'Client.code',
		'Client.updated_at',
		'Client.isActive',
		'Language.name as LanguageName',
	))
	->leftJoin('Language', 'Client.Language_id', '=', 'Language.id')
	->where('isDeleted', '!=', '1');

return Datatables::of($clients)
		->filter_column('id', 'where', 'Client.id', '=', '$1')
		->filter_column('code', 'where', 'Client.code', '=', DB::raw('UPPER($1)'))
		->filter_column('LanguageName', 'whereIn', 'Language.name', function($value) { return explode(',',$value); })
		->filter_column('updated_at', 'whereBetween', 'Client.updated_at', function($value) { return explode(',',$value); }, 'and')
		->edit_column('isActive', '@if($isActive) <span class="label label-success">Active</span> @else <span class="label label-danger">Inactive</span> @endif')
		->make();

Notes on filter_column:

Usage: filter_column ( $column_name, $method, $param_1, $param_2, ..., $param_n )

  • $column_name - the column name that search filter is be applied to
  • $method - can be any of QueryBuilder methods (where, whereIn, whereBetween, having etc.).
    • Note: For global search these methods are automaticaly converted to their "or" equivalents (if applicable, if not applicable, the column is not searched).
    • If you do not want some column to be searchable in global search, set the last parameter to "and" (see line 17 in example above). Doing this, the filter cannot be switched into its "or" equivalent and therefore will not be searched in global search .
  • $param_1 ... $param_n - these are parameters that will be passed to the selected where function ($method). Possible types:
    • string
    • DB::raw() - The DB::raw() can output literaly everything into the query. For example, subqueries or branching if you need some really sophisticated wheres.
    • function - or any other callable
    • array of any of the above
  • The search value is passed to the query by the string $1 placed anywhere in parameters. If a callable (function) is used the searched value is passed to callable as first parameter the first parameter (again see line 17).
    • The callable must return a value that will be passed to the QueryBuilder's function.

Example 4: Returning an array of objects

$posts = Post::select(array('posts.id','posts.name','posts.created_at','posts.status'));

return Datatables::of($posts)->make(true);

This returns a JSON array with data like below:

data: {
    {
        id: 12,
        name: 'Dummy Post',
        created_at: '1974-06-20 13:09:51'
        status: true
    }
    {
        id: 15,
        name: 'Test post please ignore',
        created_at: '1974-06-20 13:15:51',
        status: true
    }
}

Example 5: DT_RowID, DT_RowClass and DT_RowData

$todo = ToDoList::select(array('todo.id','todo.name','todo.created_at','todo.status'));

return Datatables::of($todo)
    ->set_index_column('id')
    ->set_row_class('@if($status=="done") success @endif')
    ->set_row_data('created_at','{{$created_at}}')
    ->make();

Example 6: Advanced usage of dataFullSupport

To better utilize dataTables mData (1.9), now columns.data (1.10) feature you may enable dataFullSupport by either setting it to true in the config file, or passing true to the second initialization argument Datatables::of($query, true)

Creating a table with a searchable and sortable joined table:

//html
<table id="user-list"></table>
//script.js
$("#users-list").dataTable({
        "processing": true,
        "serverSide": true,
        "ajax": "/api/user/datatables",
        "order": [[1,'desc']],
		"columnDefs": [ { //this prevents errors if the data is null
			"targets": "_all",
			"defaultContent": ""
		} ],
        "columns": [
            //title will auto-generate th columns
            { "data" : "id",               "title" : "Id", "orderable": true, "searchable": false },
            { "data" : "profile.last_name","title" : "Name", "orderable": true, "searchable": true },
            { "data" : "username",         "title" : "Username", "orderable": true, "searchable": true },
            { "data" : "email",            "title" : "Email", "orderable": true, "searchable": true },
            { "data" : "created_date",     "title" : "Created", "orderable": true, "searchable": true },
        ]
    });
$users = Models\User::select()->ModelJoin('profile');
        return $dataTables = Datatables::of($users)
            ->filter_column('profile.last_name','where',\DB::raw('CONCAT(profile.last_name,\' \',profile.first_name)'),'LIKE','$1')
            ->filter_column('created_at','where','users.created_at','LIKE','$1')
            //for the blade template only the array data results is provided, it is `extracted` into the template
            ->edit_column('profile.last_name', '{{ $profile["first_name"]." ".$profile["last_name"] }}')
            ->edit_column('created_at', function($result_obj) {
                //in a callback, the Eloquent object is returned so carbon may be used
                return $result_obj->created_at->format('d/m/Y - h:ia');
            })
            ->add_column('manage', '<a href="/user/edit/{{$id}}" >Edit</a>', 3)
            ->remove_column('profile.photo_id')
            ->set_index_column('row-{{ $id }}')
            ->make();
//helper scope method in base Model class
    public function scopeModelJoin($query, $relation_name, $operator = '=', $type = 'left', $where = false) {
        $relation = $this->$relation_name();
        $table = $relation->getRelated()->getTable();
        $one = $relation->getQualifiedParentKeyName();
        $two = $relation->getForeignKey();

        if (empty($query->columns)) {
            $query->select($this->getTable().".*");
        }

        //$join_alias = $table;
        $prefix = $query->getQuery()->getGrammar()->getTablePrefix();
        $join_alias = $relation_name;
        foreach (\Schema::getColumnListing($table) as $related_column) {
            $query->addSelect(\DB::raw("`$prefix$join_alias`.`$related_column` AS `$join_alias.$related_column`"));
        }
        $two = str_replace($table . ".", $join_alias . ".", $two);
        return $query->join("$table AS $prefix$relation_name", $one, $operator, $two, $type, $where); //->with($relation_name);
    }

Notes on columns.data:

  • When using the columns.data option the order the data is returned in doesn't matter.
  • You may return extra rows that you use in some tables, and ones you don't without needing to worry about ignoring them.
  • When the data is returned within enbeded arrays, datatables lets you access it using dot notation. This allows the columns.data element to address items in your table. The values of the data items are expected to match the columns (or aliases) of the table. For example, if you sort by "profile.last_name" it will use that to sort by the last_name column in the "profiles" table, so make sure that table is joined so the reference exists.
  • If you don't do a direct join you can't sort or search those columns so make sure to set those options to false in the columns array
  • If you eager load the data via Eloquent, you will still get those items back and they may be edit via edit_column just the same without needing to alias the names.

License: Licensed under the MIT License

laravel4-datatables-package's People

Contributors

alessandropietrobelli avatar anhskohbo avatar antonioribeiro avatar apizzini avatar ceesco53 avatar chrisreid avatar ethaizone avatar frankpeters avatar ionutlepi avatar jacq avatar joshkoberstein avatar langabi avatar maddhatter avatar markvaughn avatar mclassic avatar nightowl77 avatar nmkr avatar petrtr avatar phazei avatar prateem avatar reneweteling avatar toddmcbrearty avatar tortuetorche avatar umefarooq avatar xaockd avatar yajra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel4-datatables-package's Issues

Is it possible to add a column after a specified column.

$posts = Post::select(array('posts.id','posts.name','posts.created_at','posts.status'));

return Datatables::of($posts)->make();

Say I want to add a column after name. Right Now i'm hacking something like this.

$posts = Post::select(array('posts.id','posts.name','posts.id as comments','posts.created_at','posts.status'));

return Datatables::of($posts)
        ->edit_column('comments', '{{ Comment::where(\'post_id\', $id)->count() }}')
        ->make();

It would be nice if I could do this instead.

$posts = Post::select(array('posts.id','posts.name','posts.created_at','posts.status'));

return Datatables::of($posts)
        ->add_column('comments', '{{ Comment::where(\'post_id\', $id)->count() }}')->after('name')
        ->make();

Performance

Hi,
First I want to thank you for your great work.

Secondly, I would like to hear you why the performance is a little slower than the basic script from datatables.net (http://www.datatables.net/release-datatables/examples/data_sources/server_side.html)?

When I test the script with the basic script it perform about 8 ms with 50 records. And when I run your script it perform 1.19 s with the same records.

I cannot see why there should be such a big difference in performance!?

my script:

$posts = Customer::select(array('er_customers.customer_id', 'er_customers.name', 'er_customers.contact_person', 'er_customers.phone', 'er_customers.email'));

return Datatables::of($posts)->make();

Best regards
Rasmus

Sorting data on server

I may be missing something obvious, but is it possible to sort the data passed to Datatables on the server, rather than on the client? With large datasets, this would be preferable.I've tried:

$makes = Vehiclemake::select(array('id', 'make'))->orderBy('make');
return Datatables::of($makes)->make();

but the data is just returned in native stored order.

Thanks for your help.

[BUG] When using DB::raw() for raw queries the query is incorrectly added twice into the SQL

Example:

        return static::select(DB::Raw('`teams`.`id`, `teams`.`country`, '  .
            '(select max(`no_draw_streak`) from `draws` where ' .
            '`draws`.`team_id` = `teams`.`id`) as `max_no_draw_streak`, ' .
            '(select avg(`no_draw_streak`) from `draws` where ' .
            '`draws`.`team_id` = `teams`.`id`) as `avg_no_draw_streak`'));

produces this SQL:

        select `teams`.`id`, `teams`.`country`, (select max(`no_draw_streak`) from `draws` where `draws`.`team_id` = `teams`.`id`) as `max_no_draw_streak`, (select avg(`no_draw_streak`) from `draws` where `draws`.`team_id` = `teams`.`id`) as `avg_no_draw_streak`, (select max(`no_draw_streak`) from `draws` where `draws`.`team_id` = `teams`.`id`) as `max_no_draw_streak`, (select avg(`no_draw_streak`) from `draws` where `draws`.`team_id` = `teams`.`id`) as `avg_no_draw_streak`

Aggregate function looses bindings

Hey there,

Ive just updated to laravel 4.0.9 ( composer update ) and datatables has stopped working.

What i found out is that is looses its bindings

$clients->whereRaw('appointment.statusVisit_id = 1'); // works
$clients->where('appointment.statusVisit_id', '=', 1); // doesnt work
return Datatables::of( $clients )

And the error this:

SQLSTATE[HY000]: General error: 2031 (SQL: select count(*) as aggregate from (select `client`.`id` as `clientid`, `statusOffer`.`name`, `client`.`lastname`, `client`.`city`, `appointment`.`total`, `client`.`telephone`, `client`.`mobilephone`, `client`.`followup_planning`, `client`.`followup_remarks`, `slot`.`datetime`, `user`.`firstname` as `userfirst`, `user`.`lastname` as `userlast` from `address` inner join `client` on `client`.`address_id` = `address`.`id` inner join `appointment` on `appointment`.`client_id` = `client`.`id` inner join `statusOffer` on `appointment`.`statusOffer_id` = `statusOffer`.`id` left join `slot` on `appointment`.`slot_id` = `slot`.`id` left join `user` on `slot`.`user_id` = `user`.`id` where `address`.`region_id` = ? and `appointment`.`statusVisit_id` = ?) AS count_row_table) (Bindings: array ( ))

Bigg ass query, but look at the bindings, they are missing, so i think there's the problem.

Thanks!! ( loving the package by the way!! )

My config:

PHP Version 5.3.27
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"require": {
    "laravel/framework": "4.0.*",       
    "leafo/lessphp": "v0.3.9",          
    "jasonlewis/basset": "4.0.*@dev",   
    "anahkiasen/former": "dev-master",  
    "way/generators": "dev-master",     
    "intervention/image": "dev-master",
    "patricktalmadge/bootstrapper": "dev-develop",
    "jones/web-artisan": "dev-master",
    "bllim/datatables": "*",
    "juy/profiler" : "dev-master",
    "os/php-excel": "dev-master",
    "ensepar/html2pdf": "dev-master"
},
"autoload": {
    "classmap": [
        "app/commands",
        "app/controllers",
        "app/models",
        "app/database/migrations",
        "app/database/seeds",
        "app/tests/TestCase.php"
    ]
},
"scripts": {
    "post-install-cmd": [
        "php artisan optimize"
    ],
    "pre-update-cmd": [
        "php artisan clear-compiled"
    ],
    "post-update-cmd": [
        "php artisan optimize"
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
},
"minimum-stability": "dev"

}

No Unit tests

Hi,

I see that with the recent feature requests, reported bugs and pull requests occurring, people have reported that code that used to work is no longer working as expected. That tells me that this project really needs a set of unit tests for the original code base and that all pull requests should be accompanied by unit tests that pass and that all existing unit tests must continue to pass.

I didn't realize this was the case until the recent flurry of activity. I am now hesitant to use composer to update to the latest version.

I have seen this as standard practice for other open source projects and if we all chip in, perhaps this could be the way we can have confidence in the updates going forward.

Dave

Getting Exception 'Invalid table and column names format for ..." when filtering

So something has changed recently. My filtering used to work. Getting this exception on all the data tables I have. Most of my datatables are simple tables. Here's one table:

TABLE IF NOT EXISTS permissions (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
name varchar(100) COLLATE utf8_unicode_ci NOT NULL,
description varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
created_at timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
updated_at timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
deleted_at timestamp NULL DEFAULT NULL,
PRIMARY KEY (id),
KEY permissions_name_index (name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

Error is on the 'id' column. What gives? I did a composer update and have the latest "dev-master".

The database connection is default

{"error":{"type":"Exception","message":"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xxx_view.logs' doesn't exist (SQL: select count(*) as aggregate from (select id, data, membro_id, texto from logs where (application = ? and controller = ?)) AS count_row_table) (Bindings: array (\n 0 => 'xxx',\n 1 => 'usuarios',\n))","file":"D:\Users\xxx\Documents\xxx\vendor\laravel\framework\src\Illuminate\Database\Connection.php","line":556}}

The model uses $connection = 'xxx_admin' but the connection is pointing to default config "xxx_view". The error started appearing after I updated the plugin Datatables

Datatables Error after most recent update

After the latest update, adding a new item to the table from Datatables editor results in the following error:

{"error":{"type":"ErrorException","message":"array_merge_recursive(): Argument #1 is not an array","file":"\/home\/liang\/marketacuity\/www\/vendor\/bllim\/datatables\/src\/Bllim\/Datatables\/Datatables.php","line":522}}

Rolling back to 1.3.0 eliminates this error.
Thanks for sharing this plugin.

Cannot filter on prefixed table

Line 423 of Bllim\DatatablesDatatables poses a problem:

$column = $db_prefix . $column;

The result of this line is that all columns are prefixed with the table prefix. Ergo: if the column is not also prefixed with the table prefix the query throws an error "Column not found".
If you comment out line 423 filtering works just fine.

There's another stray column prefixing on line 448. This poses problems when searching with "case_insensitive" set to false.

$column = $db_prefix . $columns[$i];

Edited and removed columns aren't reflected in filter results

In my circumstance I used the following code, but had issues when searching on the Trailer # in the first table, and the Date In on both tables.

        $transactions = Transaction::select('id', 'cust_id', 'car_id');

        $transactions = DB::table('transactions')
            ->leftJoin('customers','transactions.cust_id','=','customers.id')
            ->leftJoin('cars','transactions.car_id','=','cars.id')
            ->leftJoin('employees','transactions.emp_id','=','employees.id');

        if ($type == "estimates")
            $transactions->where('transactions.estimate','=',true);
        else if ($type == "invoices")
            $transactions->where('transactions.estimate','=',false);

        $transactions->select('customers.company', 'customers.first_name', 'customers.last_name', 'cars.truck_num', 'cars.trailer_num', 'transactions.date_in', 'transactions.id', 'transactions.invoice_num');

        $data = Datatables::of($transactions)
            ->add_column('controls',
                '<span id="{{$id}}" class="controls">'.
                '<a href="{{ URL::route(\'transactions.show\', [$id]) }}"><i class="glyphicon glyphicon-file"></i></a>'.
                ($type == "estimates" ? 
                    '<a href="{{ URL::route(\'transactions.edit\', [$id]) }}"><i class="glyphicon glyphicon-pencil"></i></a>'.
                    '<a href="{{ URL::route(\'transactions.convert\', [$id]) }}"><i class="glyphicon glyphicon-arrow-right"></i></a>' : '').
                '</span>'
                )
            ->edit_column('first_name','{{$first_name}} {{$last_name}}')
            ->edit_column('date_in','{{ FormatController::datetime($date_in) }}')
            ->remove_column('id')
            ->remove_column('last_name')
            ->remove_column('make')
            ->remove_column('model')
            ->remove_column(($type == "estimates" ? 'invoice_num': ''))
            ->make();
        return $data;

dt1


After some debugging I found that when I commented out the adds/edits/deletions on columns I could see what I was really searching on.

        $data = Datatables::of($transactions)
            // ->add_column('controls',
            //  '<span id="{{$id}}" class="controls">'.
            //  '<a href="{{ URL::route(\'transactions.show\', [$id]) }}"><i class="glyphicon glyphicon-file"></i></a>'.
            //  ($type == "estimates" ? 
            //      '<a href="{{ URL::route(\'transactions.edit\', [$id]) }}"><i class="glyphicon glyphicon-pencil"></i></a>'.
            //      '<a href="{{ URL::route(\'transactions.convert\', [$id]) }}"><i class="glyphicon glyphicon-arrow-right"></i></a>' : '').
            //  '</span>'
            //  )
            // ->edit_column('first_name','{{$first_name}} {{$last_name}}')
            // ->edit_column('date_in','{{ FormatController::datetime($date_in) }}')
            // ->remove_column('id')
            // ->remove_column('last_name')
            // ->remove_column('make')
            // ->remove_column('model')
            // ->remove_column(($type == "estimates" ? 'invoice_num': ''))
            ->make();
        return $data;

dt2


I found that I could temporarily fix my issue by moving the columns I removed from the dataset to the end of the array so that the ones I did use would be able to be filtered.

$transactions->select('customers.company', 'customers.first_name', 'customers.last_name', 'cars.truck_num', 'cars.trailer_num', 'transactions.date_in', 'transactions.id', 'transactions.invoice_num');

I also noticed that if I made this latest change and left the adds/edits/deletions commented out my table still showed what it was really filtering on, the original data.

dt3

I haven't tested the issue for added columns but I assume they aren't searchable as well.

The strtolower functions makes Datatables incompatible with CamelCase'd database columns

Hi Guys

I have been tasked with writing a new admin for a 12 year old database. Naturally I chose Laravel and found this awesome package. :)

I did run into trouble though. The original programmers used CamelCase'd column names all over the database.

Datatables by itself works fine (because I aliased all the column names to lowercase), but search breaks because of the join. For example

    $orders = OrderHistory::leftjoin('wwwUser', 'wwwUser.wwwUserID', '=','orderHistory.user_id' )
      ->select(array(
            'orderHistory.id as id', 
        'wwwUser.wwwUserID as userid', 
            'order_type', 
            'wwwUser.username as byuser', 
            'orderHistory.dateCreated as date_ordered'));

        Datatables::of($orders)... etc etc

While the initial Datatable itself works fine for that, when I try to use the search box Datatables is clever enough to figure out it must search on the wwwUserID too. The problem is that it forces the column name to lower case, resulting in the error

log.ERROR: exception 'Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'wwwuser.wwwuserid' in 'where clause'

I did some testing and found that if I remove all the calls to "strtolower", except the one in the wildcard function, everything works 100%. I am however not sure if strtolower plays some vital role somewhere else, and would appreciate some feedback.

Thank you

Sorting columns with mysql functions fails

I found that if you are sorting on columns that have functions in the select such as CONCAT or DISTINCT it puts the functions in the where clauses. This also occurs if you alias a field. eq...( field_name as fn)

I've added this function in

private function cleanColumns( $cols )
{
        //just add in more functions if you use them
   //i add spaces before and after parenthesis if you do not remove the spaces below
        $_search = [
        'GROUP_CONCAT( ',
        'CONCAT( ',
        'DISTINCT( ',
        ',',
        ' )',
        'as',
    ];

    foreach ( $cols as $col )
    {
        $_column = explode( ' ' , str_replace( $_search, '', $col, $count ) );

        if ( $count > 0 )
        {
            $columns[] = array_shift( $_column );
        }
        else
        {
            $columns[] = end( $_column );
        }
    }

    return $columns;
}

then added this to the top of the filtering() function

$columns = $this->cleanColumns( $this->columns );

then just below

$copy_this = $this;

add

$copy_this->columns = $columns

then in this for loop

for ($i=0,$c=count($columns);$i<$c;$i++)

change

$this->columns to $columns

also in the ordering() function just after

    if(!is_null(Input::get('iSortCol_0')))

add

$columns = $this->cleanColumns( $this->last_columns );

then change

$this->last_columns to $columns 

in the for loop

seems to work let me know if there is a better way

Incorrect count with Eloquent query including subqueries

Whenever I run an Eloquent query that includes a subquery, the total count ends up being null and outputs as NaN. However, changing the following seems to solve the issue for me:

in the count method:
$this->count_all = $this->query->count();

changed to:
$this->count_all = get_class($this->query) == 'Illuminate\Database\Query\Builder' ? $this->query->count() : $this->query->get()->count();

However I'm not sure if this would be the best way but perhaps someone could look into it. Thanks.

doesn't order properly with subqueries

When I am selecting a subquery and want to order by that column, the package is currently using the entire subquery in the ORDER BY instead of just the alias that it is assigned to.

For example, the code:
$query = $model->select(["id", DB::raw("(SELECT SUM(rate) FROM other_table) AS rate")]); return Datatables::of($query)->make();

would return a query something like the following if I order it by rate:

SELECT id, (SELECT SUM(rate) FROM other_table) as rate FROM model_table ORDER BY (SELECT SUM(rate) FROM other_table) AS rate;

That gives an error where it should be something like:
SELECT id, (SELECT SUM(rate) FROM other_table) as rate FROM model_table ORDER BY rate;

if the model is soft delete, the SQL statement does not look right

if the model is soft delete, it will add users.deleted_at is null into the SQL statement in the "or" list and it will cause all the search filter "successful" all the time.

select id, name, phone, email, md5id from users where users.deleted_at is null and (users.deleted_at is null or id LIKE ? or name LIKE ? or phone LIKE ? or email LIKE ? or md5id LIKE ?)

Filtering and column reorder

Hi,
I use this package, and I can say that it is excellent.
I have some problems with column filtering and dynamically added columns to the datatable. For example on server-side filters from the first column, received parameters (like bSearchable) from the zero column.There is an example of columns

"aoColumnDefs": [
                    {
                        "aTargets": [ 0 ],
                        "mData": null,
                        "sWidth": "30px",
                        "bSortable": false,
                        "bSearchable": false,
                        "sClass": "center",
                        "mRender": function ( data, type, full ) {
                            return \'<input type="checkbox" />\';
                        }
                    },
                    {
                        "aTargets": [ 1 ],
                        "mData": 0,
                        "sWidth": "100px",
                        "sName": "product_id"
                    },
                    {
                        "aTargets": [ 2 ],
                        "mData": 1,
                        "sName": "product"
                    },
                    {
                        "aTargets": [ 3 ],
                        "mData": 2,
                        "sWidth": "100px",
                        "sName": "group"
                    },
                    {
                        "aTargets": [ 4 ],
                        "mData": null,
                        "sWidth": "120px",
                        "bSortable": false,
                        "bSearchable": false,
                        "mRender": function ( data, type, full ) {
                            var aBut = \'<a href="#" class="btn btn-small btn-primary">Edit</a>\';
                            aBut += \'<a href="#" class="btn btn-small btn-danger confirm">Delete</a>\';
                            return aBut;
                        }
                    },
                ],

Then I get vars like this in query string

sEcho:14
iColumns:5
sColumns:,product_id,product,group,
iDisplayStart:0
iDisplayLength:10
mDataProp_0:null
mDataProp_1:0
mDataProp_2:1
mDataProp_3:2
mDataProp_4:null
sSearch:
bRegex:false
sSearch_0:
bRegex_0:false
bSearchable_0:false
sSearch_1:7
bRegex_1:false
bSearchable_1:true
sSearch_2:asu
bRegex_2:false
bSearchable_2:true
sSearch_3:12
bRegex_3:false
bSearchable_3:true
sSearch_4:
bRegex_4:false
bSearchable_4:false
iSortCol_0:2
sSortDir_0:asc
iSortingCols:1
bSortable_0:false
bSortable_1:true
bSortable_2:true
bSortable_3:true
bSortable_4:false

There is a mDataProp_% parameter, something like pointer from datatable column index to db index. I have used this parameter for a small change in logic in filtering method. Here it is:

private function filtering()
    {
        $column_reorder = array();
        foreach(Input::get() as $key => $value)
        {
            if(strpos($key, 'mDataProp_') !== false)
            {
                $num = explode('_', $key);
                $column_reorder[$value] = $num[1];
            }
        }

        if (Input::get('sSearch','') != '')
        {
            $copy_this = $this;

            $this->query->where(function($query) use ($copy_this) {

                $db_prefix = $copy_this->database_prefix();

                for ($i=0,$c=count($copy_this->columns);$i<$c;$i++)
                {
                    $r = $i;
                    if (isset($column_reorder[$i])) $r = $column_reorder[$i];
                    if (Input::get('bSearchable_'.$r) == "true")
                    {

                        preg_match('#^(\S*?)\s+as\s+(\S*?)$#si',$copy_this->columns[$i],$matches);
                        $column = empty($matches) ? $copy_this->columns[$i] : $matches[1];
                        $keyword = '%'.Input::get('sSearch').'%';

                        if(Config::get('datatables.search.use_wildcards', false)) {
                            $keyword = $copy_this->wildcard_like_string(Input::get('sSearch'));
                        }

                        if(Config::get('datatables.search.case_insensitive', false)) {
                            $column = $db_prefix . $column;
                            $query->orwhere(DB::raw('LOWER('.$column.')'), 'LIKE', $keyword);
                        } else {
                            $query->orwhere($column, 'LIKE', $keyword);
                        }
                    }
                }
            });

        }

        $db_prefix = $this->database_prefix();

        for ($i=0,$c=count($this->columns);$i<$c;$i++)
        {
            $r = $i;
            if (isset($column_reorder[$i])) $r = $column_reorder[$i];
            if (Input::get('bSearchable_'.$r) == "true" && Input::get('sSearch_'.$r) != '')
            {
                $keyword = '%'.Input::get('sSearch_'.$r).'%';

                if(Config::get('datatables.search.use_wildcards', false)) {
                    $keyword = $copy_this->wildcard_like_string(Input::get('sSearch_'.$r));
                }

                if(Config::get('datatables.search.case_insensitive', false)) {
                    $column = $db_prefix . $this->columns[$i];
                    $this->query->where(DB::raw('LOWER('.$column.')'),'LIKE', $keyword);
                } else {
                    $this->query->where($this->columns[$i], 'LIKE', $keyword);
                }
            }
        }
    }

I do not know it is possible to solve this problem through js. Thanks.

Incorrect Type Error

Updating to the latest version via packagist is now generating the following error
[message] => Argument 1 passed to Illuminate\Database\Query\Builder::setBindings() must be of the type array, object given, called in /web/sites/app/current/vendor/bllim/datatables/src/Bllim/Datatables/Datatables.php on line 480 and defined
[lineContents] => */

-> public function setBindings(array $bindings)

{


[code] => 4096

function count() needs to check whether query is fluent or eloquent - solution provided

Hi,

I modified the count method to get it to work properly. basically to check whether the query is fluent or eloquent based first like he does in the saveQuery method. Perhaps this could be modified by the author?


private function count()
    {
        //Get columns to temp var.
        $query_type = get_class($this->query) == 'Illuminate\Database\Query\Builder' ? 'fluent' : 'eloquent';
        $columns = $query_type == 'eloquent' ? $this->query->getQuery()->columns : $this->query->columns;

        $this->count_all = $this->query->count();

        //Put columns back.
        $this->query->select($columns);
    }

[ Bug ?] Filtering on prefixed table.

I got a column(s) not found on prefixed table whenever I preform filtering on dataTables.
I dig into the code and I think I found a little bug that caused this problem.

at Datatables.php:401, from

$doctrine_column = DB::getDoctrineColumn($table, $target_column);

to,

$doctrine_column = DB::getDoctrineColumn($db_prefix . $table, $target_column);

at Datatables.php:409, from

if(Config::get('datatables.search.case_insensitive', false)) {
    $column = $db_prefix . $column;
    $query->orwhere(DB::raw('LOWER(CAST('.$column.' as CHAR('.$column_max_length.')))'), 'LIKE', $keyword);
} else {
    $query->orwhere(DB::raw('CAST('.$column.' as CHAR('.$column_max_length.'))'), 'LIKE', $keyword);
}

to

$column = $db_prefix . $column;
if(Config::get('datatables.search.case_insensitive', false)) {
    $query->orwhere(DB::raw('LOWER(CAST('.$column.' as CHAR('.$column_max_length.')))'), 'LIKE', $keyword);
} else {
    $query->orwhere(DB::raw('CAST('.$column.' as CHAR('.$column_max_length.'))'), 'LIKE', $keyword);
}

Putting calculated values into a table?

Hi, there!

I've been struggling with writing calculated values to a datatable (for instance, to enter a full name in a column, rather than first and last names). Eventually, I ended up doing this:

class Person extends Eloquent
{
    public function search()
    {
        $items = self::select(array('id'));
        return Datatables::of($items)
            ->add_column('name', '{{ MyModel::find($id)->name }}', 0)
            ->remove_column('id')
            ->make();
    }

    public function getNameAttribute()
    {
        return $this->first_name . ' ' . $this->last_name;
    }
}

This works, but seems a bit kludgy. Is there a better way to do it?

Thank you,

--joel

Class 'Controllers\Admin\Datatables' not found

I admit that I am new to Laravel and it might just be something simple and I thank you in advance for your help.

I started off with the Laravel4 Started Kit (https://github.com/brunogaspar/laravel4-starter-kit) for a brand new project, and the only other thing I did was download this package to see if i could make it work. I followed the install directions to the T for both the starter kit and for this package. It seemed like everything installed fine.

But then I go to try out a Datatable. I tried editing the controllers/admin/BlogsController.php by placing something similar to the following in the getIndex function:

$posts = Post::select(array('posts.id','posts.title','posts.created_at'));
return Datatables::of($posts)->make();

The problem is that when I run the page again with Datatables, I get the following error:

Class 'Controllers\Admin\Datatables' not found

Any suggestions? Why can't the starter kit understand where to look for the Datatables class? Thanks.

Eloquent->toArray() return all attributes in Model.

Last laravel update has update many in Eloquent. I use your package so I found these out and think it's very bug.

Another pull request at yesterday is one of them and today I found another one. I use Datatable with Sentry User and Sentry must set some data to Attributes in Model. Those attributes with return out when we call ->toArray().

at Datatables.php Line: 79

$this->result_array = $this->result_object->toArray();

Attributes will get out too because Array don't have method so If dev get array out, they can't get attributes out later. It's right choice for dev in laravel.

I has problem that I use Datatable with Sentry and Sentry handle Model as itself. It use attributes inside thier model so when Datatable call user model and ->toArray(). Attributes will all out.

This is my fix method but I don't create pull request because I want you who dev datatable give decision to this will should use it or not.

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected   $hidden = array();

    /**
     * Set the hidden attributes for the model.
     *
     * @param  array  $hidden
     * @return void
     */
    public function setHidden(array $hidden)
    {
        $this->hidden = $hidden;
        return $this;
    }

//-........

    private function getResult()
    {
        if($this->query_type == 'eloquent')
        {
            $this->result_object = $this->query->get();
            $hidden = $this->hidden;
            $this->result_object->map(function($model) use ($hidden) {
                $model->setHidden($hidden);
            });
            $this->result_array = $this->result_object->toArray();
        }
        else
        {
            $this->result_object = $this->query->get();
            $this->result_array = array_map(function($object) { return (array) $object; }, $this->result_object);
        }
    }

When I call Datatable. (Example code)
Model user are Sentry User.

        $users = User::select('id', 'first_name', 'last_name','email', 'permissions', 'users.last_login');

        return Datatables::of($users)
            ->editColumn('first_name','{{ $first_name }} {{ $last_name }}')
            ->removeColumn('last_name')
            ->setHidden(array('activated','login'))
            ->make();

This way will make setHidden() is something like removeColumn() but It's for remove attributes from array.

Sorting issue

Hiya,

I have been breaking my head over my issue for a couple of hours now and really seem not be able to find the cause of my issue. I hope someone here would be able to point me in the right direction on how to fix this.

I end up with the following query:

select MAX(CASE WHEN campaign_entry_field_values.campaign_field_id = 13 THEN campaign_entry_field_values.value ELSE NULL END) as naam, MAX(CASE WHEN campaign_entry_field_values.campaign_field_id = 14 THEN campaign_entry_field_values.value ELSE NULL END) as emailadres, MAX(CASE WHEN campaign_entry_field_values.campaign_field_id = 22 THEN campaign_entry_field_values.value ELSE NULL END) as voornaam, `campaign_entries`.`created_at` from `campaign_entries` inner join `campaign_entry_field_values` on `campaign_entries`.`id` = `campaign_entry_field_values`.`campaign_entry_id` where `campaign_entries`.`campaign_id` = 15 group by `campaign_entries`.`id` order by `campaign_entries`.`created_at` desc limit 10 offset 0

This displays results in the Datatables as wished however I seem to be unable to get the sorting fucntion on the columns to work.

No matter on which column I sort I always end up with the

group by `campaign_entries`.`id`

Any help would be much appreciated.

  • Mark

SQL Error on Column Filter with Joined Table

Hello,
I get a SQL error during a column filtering in a Joined Datatables. I founded that the problem is in the function filtering() of Datatables.php around the line 428.

It is getting the name of the column with the declaration like: tablejoined.column as newcolumn LIKE .......

I fixed it in a simple way just using the same code as the normal filter using

$copy_this = $this;
preg_match('#^(\S_?)\s+as\s+(\S_?)$#si',$copy_this->columns[$i],$matches);
$column = empty($matches) ? $copy_this->columns[$i] : $matches[1];

Hope this help someone and you can fix it in the next release. So I can update it without problem.

Bye bye Andrea

Datatables is stuck at processing

Hello.
I have a strange issue with datatables on my server.
If I set "bServerSide": true, then the ajax call is done perfectly, the json returned is ok (status is 200) BUT it is stuck at processing...

For exactly the same page/data/ajax call, if I switch to "bServerSide": false then the I see the data ,although pagination/search/items per page does not work (since its set to false, I know :) )

Any ideas why it might get stuck at processing ?

Error using Fluent queries

I get an error if I use Fluent queries with this package.

[2013-08-13 10:32:45] log.ERROR: exception 'BadMethodCallException' with message 'Call to undefined method Illuminate\Database\Query\Builder::getQuery()' in /var/www/project.dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1584

Using Eloquent it works perfectly.
thanks

Add Column Reorder

I think it would be great if you could assign a column number to add_column for instance if I wanted it to be first.

Chinese chracter cannot search

Thanks for your work, but I find that can not search use Chinese character, of course, this maybe associated with laravel, you have any suggestions?

in response, sColumns should be a string instead of an array

When Searching From Data Table Seach Box : Error when giving alias to column

When we give alias to a column, where condition is causing an issue, perhaps its using alias name in where condition for checking.

{"error":{"type":"Exception","message":"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users' in 'where clause' (SQL: select count(*) as aggregate from (select roles.id, roles.name, roles.id as users, roles.created_at from roles where (roles.id LIKE ? or roles.name LIKE ? or users LIKE ? or roles.created_at LIKE ?)) AS count_row_table) (Bindings: array (\n 0 => '%a%',\n 1 => '%a%',\n 2 => '%a%',\n 3 => '%a%',\n))","file":"\vendor\laravel\framework\src\Illuminate\Database\Connection.php","line":556}}

My Server Side Code

$users = User::leftjoin('assigned_roles', 'assigned_roles.user_id', '=', 'users.id')
->leftjoin('roles', 'roles.id', '=', 'assigned_roles.role_id')
->select(array('users.id', 'users.username','users.email', 'roles.name as rolename', 'users.confirmed', 'users.created_at'));

return Datatables::of($users)

Undefined method getQuery()?

Call to undefined method Illuminate\Pagination\Paginator::getQuery()
Datatables.php153

private function save_query($query)
{
    $this->query = $query;
    $this->query_type = get_class($query) == 'Illuminate\Database\Query\Builder' ? 'fluent' : 'eloquent';
    $this->columns = $this->query_type == 'eloquent' ? $this->query->getQuery()->columns : $this->query->columns;
}

sorting on added columns not working

Hi,

I have a datatable where i created an additional column like this:


return Datatables::of($assignments)
    ->add_column('photographers','{{$first_name . " " . $last_name }}' )
    ->remove_column('first_name')
    ->remove_column('last_name')
    ->make();

I no longer needed first_name and last_name columns as I do not display them in the datatable.
In the datatable set up I use:


"aoColumns": [
    /* Id */   { "bSearchable": false,
                 "bVisible":    false },
    /* Start Date    */  null,
    /* Venue         */  null,
    /* Request Date  */  null,
    /* Photographers */  null}

The start date, venue and request date columns are all properly sortable however the last one which I added with your add on is not.

Can you investigate if there is anything I need to do or if there is a patch that needs to be added?

Thanks
Dave

Filtering does not work with bServerSide: true

Hi there,

Everything was fine on Laravel 4.0, now i used 4.1 (new project), and when getting my Data from the Server the Filtering function does nothing. Using Firebug, i can see requests including the search term send to the server and responses received (no errors), but the response always seems to include the whole dataset without any filtering applied.

Here my Jquery part

            $('.ajaxtable1').dataTable( {
                "bServerSide": true,
                "sAjaxSource": "/products/datatable",
                "bStateSave": true,
                "iDisplayLength": 25
            });

And here the server side code

    public function datatable(){
        $products = Product::select(
                        array(
                            'products.id',
                            'products.product_code',
                            'products.product_name'
                        )); 
        return Datatables::of($products)->make();
    }   

Changing bServerSide to false makes it work as normal. Any Ideas?

Can't searching use whereRaw

If use
DB::table('documents')->select('subject');

everything perfectly.

If use
DB::table('documents')->select('subject')
->whereRaw('FIND_IN_SET(:varId,author)',array('varId'=>$uid));

I can get the queries,but can't use 'search',whether number or character. Here is the error:

{"error":{"type":"Exception","message":"SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters (SQL: select count(*) as aggregate from documents where FIND_IN_SET(:varId,leader) and (subject LIKE ?)) (Bindings: array (\n 0 => '1',\n 1 => '%d%',\n))","file":"\xxx/vendor/laravel/framework/src/Illuminate/Database/Connection.php","line":556}}

Help pls.

Issue 27

Issue #27 is still open. Because I couldn't reopen it, I opened a new issue to remind.

Regular expression modification

Hi, i want to use with laravel this in select:

YEAR(FROM_UNIXTIME(date)) as birth

I've been checking the datatable.php file and i found this, maybe i can change it to admit this:

preg_match('#^(\S*?)\s+as\s+(\S*?)$#si',$copy_this->columns[$i],$matches);

When i try to filter a column i am getting an error, but if i get the table without filterring any result it's ok, what i can do?

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

Thanks

Eloquent causes segfault with Apache/MAMP

Hi,
I encounted some problems using your package (MAMP 2.1.3 / PHP 5.4.10). I tried to generate a simple datatable JSON, but chrome showed the response as failed although the response code was 200 OK and I was able to see the JSON-string if I pointed the browser to the endpoint.
image
image

Further investigation in the apache error_log showed segfault messages on each request to the datatables view. Sat Aug 03 00:28:59 2013] [notice] child pid 62444 exit signal Segmentation fault (11)

However, if I switch from eloquent to fluent querys, the segfault is gone and everything works as expected.

It seems that there is a bug in this package or the laravel core.

Versioning

It would be nice to get this repo tagged with releases so we can tie apps to specific versions easily.

Problem using aggregate functions like group concat.

I'm having issues using group_concat with datatables.
The query runs perfectly and the results are shown as expected.
The problem appears when I do a search.

When using aggregate functions, the filtering should be done with "having" instead of "where" and, at the moment, it seems that it's not supported.

There's no way of "extending" the package and overriding the filtering method as all methods are private, so I was wondering if there's a solution for this predicament.

result keys

i much prefer to have the returned result to have the column key names rather then numberically indexed.
in the regulate_array function you add array_values which removes this.
Perhaps this should be an options of sorts to return as named keys or numerically indexed.

Create a configuration file

I want the search filter to be case_insensitive by default.
I see that you have already think of it in your source but when I publish the configuration file of the package, there is no file at all...
I created my own configuration file under app/config/packages/bllim/datatables/config.php and I put the following code in it :
return [
'search' => [
'case_insensitive' => true
]
];

I also modify your Datatables.php class by replacing all the
Config::get('datatables.
by
Config::get('bllim/datatables::

But my search field is still case sensitive.
Maybe I'm missing something.

EDIT : Ok it's working ! I had to set the package name in DatatablesServiceProvider.php :
$this->package('bllim/datatables');
to
$this->package('bllim/datatables', 'bllim/datatables');

I think it will be good to update this.

Thanks in advance for some help

Get id from query

Hi,

I'm trying to get the ID from the query when I use edit_column but I get it only for the 'id' column, when I try to get it for the 'operations' column I get the html markup of the 'id' column.

public function ajaxGetAllPages()
    {
        $pages = Page::select(array('id','title','updated_at','status'));
        return Datatables::of($pages)
        ->edit_column('id', '<input type="checkbox" class="checkboxes tooltips" value="{{ $id }}" data-placement="left" data-original-title="&nbsp;אינדקס # {{ $id }}&nbsp;" />')
        ->edit_column('title','<a href="{{ URL::route( \'admin.pages.index\') }}">{{ $title }}</a>')
        ->edit_column('updated_at', '{{ date("d-m-Y | H:i",strtotime($updated_at)) }}')
        ->edit_column('status', '{{ $status }}')
        ->edit_column('operations',
                        '<a href="#" data-id="{{ $id }}" class="btn btn-xs blue btn-editable tooltips" data-placement="top" data-original-title="עריכה"><i class="fa fa-pencil"></i></a>
                         <a href="#" data-id="{{ $id }}" class="btn btn-xs dark btn-trash tooltips" data-placement="top" data-original-title="לארכיון"><i class="fa fa-trash-o"></i></a>
                         <a href="#" data-id="{{ $id }}" class="btn btn-xs red btn-removable tooltips" data-placement="top" data-original-title="מחיקה"><i class="fa fa-times"></i></a>
                         <div class="btn-group">
                            <button class="btn default btn-xs dropdown-toggle" type="button" data-toggle="dropdown">עוד <i class="fa fa-angle-down"></i></button>
                            <ul class="dropdown-menu pull-right" role="menu">
                                <li><a href="#">פעולה</a></li>
                                <li><a href="#">פעולה</a></li>
                            </ul>
                         </div>'
        )
        ->make();
    }

Markup result - http://screencast.com/t/nIefrpqc8

Am I doing something wrong?

Thanks,
Chen

Namespaced Models

After fixes for #27 and #28 datatables is broken for me:

Class 'Mymodel' not found - Datatables.php:493

This is clear because i use namespaced models like \App\Models\Mymodel so "Mymodel" without namespace can't be resolved in datatables.php

So i think $model should not be computed from table name?

Search

Could you provide an example of how search should work? It just says processing.. forever for me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.