Previous post we have learn how to use DataTables Example with PHP,in this article we will learn how to add rowid and rowclass with each row into data table.Some times we need to identify each row based on id or row class.Jquery datatable has many properties for easy handle datatable with server side.
Also Checkout other tutorial of Datatable,
The following are three properties which is used to identify unique each row.
We will add id on each row of table using below syntax.
array("DT_RowId"=> "6",'Name'=>'parvez', 'Empid'=>11, 'Salary'=>101)
with help of above code, you can see ‘6’ id has been attached against with ‘parvez’ row data like below,
<tr id="6"><td>Parvez<td> ...</tr>
This tutorial helps integrate a PHP SDK with Laravel. We'll install aws-php-sdk into laravel application and access all aws services… Read More
in this quick PHP tutorial, We'll discuss php_eol with examples. PHP_EOL is a predefined constant in PHP and represents an… Read More
This Laravel tutorial helps to understand table Relationships using Elequonte ORM. We'll explore laravel table Relationships usage and best practices… Read More
We'll explore different join methods of Laravel eloquent with examples. The join helps to fetch the data from multiple database… Read More
in this Laravel tutorial, We'll explore valet, which is a development environment for macOS minimalists. It's a lightweight Laravel development… Read More
I'll go through how to use soft delete in Laravel 10 in this post. The soft deletes are a method… Read More
View Comments
where to put this array. Please give the example code if you can
Hi Nadeem,
You need to create your rows data as like array("DT_RowId"=> "6",'Name'=>'parvez', 'Empid'=>11, 'Salary'=>101),as per my understanding u do not have DT_RowId col in ur reponse, so u need to add DT_RowId col in php response.