Non Order Column - show stop icon
Non Order Column - show stop icon
Hello Everyone,
I saw somewhere for a non orderable column, when mouse over on column header
<th>Actions</th> , you see a stop icon.
Q1) How do I achieve this please in using DataTable
Q2) in my code below i got edit, delete and read buttons, i would like to know how I could call a modal window and pass or bind the data:'id' value, so the respective modal window will open with the correct record.
Q3) The search on date filed, in my case is hiredata, the datatable search for dates, how to achieve this please.
'columns': [{
data: 'id'
},
{
data: 'emp_name'
},
{
data: 'salary'
},
{
data: 'gender'
},
{
data: 'city'
},
{
data: 'hiredate'
},
{
"bSortable": false,
"orderable": false,
"data": "null",
"className": "center",
"defaultContent": '<a type="button" class="edit btn btn-default btn-sm"> <span class="glyphicon glyphicon-edit"></span></a> <a type="button" class="delete btn btn-default btn-sm" > <span class="glyphicon glyphicon-trash"></span></a> <a type="button" class="view btn btn-default btn-sm" > <i class="fa fa-folder-open" aria-hidden="true"></i></a>'
}
]
This question has an accepted answers - jump to answer
Answers
Hi @SalmanS ,
You can modify the
title
attribute incolumns.render
(something like this)This SO thread may help
All fields are searchable, so I don't understand why this one wouldn't be. A test case is needed here for this. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Cheers,
Colin
Many thanks Colin,
Q1)
I tried the following and able to capture the value for column(0)
Since I am using responsive.nightly, the moment you switch to mobile mode it is capturing responsive values of the columns i.e., column 3 4 5... not eq(0) column (0).
am I missing something?
Tried this two still its capturing responsive column 0 instead of row column 0
Hi @SalmanS ,
There's a lot going on there - it would help if you could produce a test case or link to your page. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Many thanks colin,
Here is my js datatable:
live.datatables.net/gocuzusa/6/edit
I manage to get it working by adding a extra column and retrieving by using echo json_encode ($response) and I am not sure is there any better way to achieve this.
======= PHP ServerSide ============
`## Run loop of records and returns as json_encode
Response`
==== Javascript ====
Hi @SalmanS ,
Glad all working, yep, seems a reasonable way to go.
Cheers,
Colin