How to use / express each state visibility to do something ?
Sorry I don't understand the question.
How to make the length menu to any other number (for example 25 rows per page and total selections have 10, 20, 25. 50 etc.) rather than the first one as default setting ?
It shows adding draw before Datatable initialization occurs with draw.dt. This is so the event fires during any draw functions during initialization. It also shows adding the event after which will fire on draw events after Datatable initialization. You can see this by performing either a search, sort or page action.
This is not a Datatables issue but an issue with how you are tracking the data. Same as the last time. You need to use a unique piece of data to restore the classes to the appropriate cell. I would look at saving the row ID plus column index, maybe use $(this).index(), instead of the cell's text. For example save each clicked cell as an array like this: [rowID, column index].
Answers
Hi,
We updated the test case sample as
https://live.datatables.net/tuxohazo/12/edit
for the below query.
The method we illustrated there is good ? or have better solutions ?
Using this initialization method / settings at
https://live.datatables.net/tuxohazo/7/edit
How to add
table.on('draw', function() {}
and
drawCallback: function(settings) {}
Hanna / George & friends.
See if the one of the Column Visibility examples does what you want.
Sorry I don't understand the question.
Use
lengthMenu.This updated example shows using
drawCallbackanddraw.https://live.datatables.net/tuxohazo/13/edit
It shows adding
drawbefore Datatable initialization occurs withdraw.dt. This is so the event fires during any draw functions during initialization. It also shows adding the event after which will fire on draw events after Datatable initialization. You can see this by performing either a search, sort or page action.Kevin
Hi,
our question was
how to state that
if the condition that column 2 is visible
if that true
then do something {}.
and vice versa.
Similarly about the length menu
For example
lengthMenu: [10, 25, 50, 75, 100]
here 10 is the state of the total rows per page ?
So the query was
how to
make 25 or 50 as the default state
and shown value.
But the length menu contains the same value as mentioned above.
Hope you understand it ?
Martha
Use
column().visible()for this.Use
pageLengthfor this.Kevin
Hi,
drawCallback: function (settings) {
remaining code at https://live.datatables.net/tuxohazo/15/edit
We try to add a class to the active / last clicked cell.
That works well.
But we use .text() to get the element.
And the problem is
if have any number of cells having the same text is added the applied class.
We only needs to apply the current clicked cell only
So how to achieve that ?
Sarah.
This is not a Datatables issue but an issue with how you are tracking the data. Same as the last time. You need to use a unique piece of data to restore the classes to the appropriate cell. I would look at saving the row ID plus column index, maybe use
$(this).index(), instead of the cell's text. For example save each clicked cell as an array like this:[rowID, column index].Kevin