-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't instantiate checkboxes on datatable #167
Comments
I'm having the same issue, could not find the solution. This is what i have tried using datatables call back function but with no success, fnDrawCallback:function (oSettings) {
|
@DawnOfHell Anyway, so I was having same problem with my other project where I have long text of description in last column and I was required to truncate text and add show more link if the text is longer than one line. I do it using JavaScript, so I needed to access content from last column as jQuery object, find specific class from that content, and manipulate it. Datatable provides a descent way to do that. You need to get the content of particular column as jQuery object and than do your javascripting there.
Also, you might be interested in datatable's |
Below code works for switches on datatable. Approach is the same as I mentioned in my above comment.
|
@harsh18594
i can get check box in every row, but unable to get the switchery working, all of the data for the datatable are coming from ajax request. |
@AnuroopSuresh well, I haven't tried above code with ajax. if your best options I could think of is (not tested),
Alternatively, you could try using https://datatables.net/forums/discussion/48103/callback-function-every-time-new-data-is-completely-loaded I haven't worked with datatables a lot, so unfortunately I can't suggest best ways for it. |
Hi @harsh18594 |
Hello,
First of all, it is a great plugin to create switches easily.
I am using it to convert my checkbox to switch. Problem I am facing here is, I have a list of items in the datatable all has a switch element with it to make an ajax call. length of datatable is 10.
Using above code, It instantiates first 10 checkbox (first page of datatable) as a switch within datatable plus all other checkbox on the page that are visible on initial load. But it doesn't instantiate any checkbox that are not on first page of datatable. they remain as normal checkbox. So, if I navigate to second or any other page of datatable using datatable pagination, all checkbox are as default HTML checkbox.
I tried instantiating switch on datatable pagination event, but it duplicates the existing switches as well, and it doesn't instantiate switch when I navigate to second page for the first time. I have to open second page, go back to first page and again go to second page to see them as switch. (this is potentially datatable related thing)
Is there a way to instantiate the checkboxes that are not visible on page but are actually on the page?
Due to business constraints, I cannot provide a code.
The text was updated successfully, but these errors were encountered: