datatable into bootstrap modal
datatable into bootstrap modal
Hi guys,
I would like to manage a address book through a datatable displayed in a bootstrap modal.
In practice, in the main map I click the address book button and I see the list of contacts that can be divided by company. It follows that at the first opening of the modal it shows me only the contacts that are not associated with a company and then recharge datatable to every company selection. At the end of the modal recovery the selected contacts.
I had thought: in initialization load datatable with all the contacts in the database and then reload depending on the company selected by my dropdownlist. But I do not know how I would be. That is, to the onchange event of the awning I would call a javascript method but how can I filter the rows of the datatable through the possible hidden column company?
Sorry for my english
Replies
Hi @Giulo ,
You can filter on all columns, hidden or visible, with
column().search()
. So you could search on there to filter for the companies.Hope that helps,
Cheers,
Colin
Hi @Colin, thx.
But then I must initialized datatable with all database contacts and then filter by company id?
Hi @Giulo ,
That's an API call, so you can call it at anytime, it doesn't have to be initialisation.
Cheers,
Colin
Hi @Colin,
this is my datatable init:
Company id is second column hidden.
When I select my a company on change I call this function:
Datatable not change data. I don't find my error
I think that 'columns' for all and for a specific index column then I've try this:
not working again!
Hi @Giulo ,
This example here shows it working - searching on a hidden column (only the 13 London offices are listed).
Could you modify that example, or create your own, that demonstrates the problem, please.
Cheers,
Colin
Hi @Colin,
My code is same yours but continue to load all data into dataSet:
Hi @Colin,
I don't understand but if I eneble pagination work good!
That does sound odd - a live example would really help to understand this.
C
I've try and the problem was option "bFilter: false"