TableTools and select boxes
TableTools and select boxes
mathieufannee
Posts: 17Questions: 0Answers: 0
Hi,
I have a question about Datatables in combination with TableTools:
In some columns of a table, I'm using 'mRender' to display the data as 'select boxes' (dropdown). The reason why I'm doing that, is that it allows users to edit the table, but they can't enter invalid values, since the select boxes only allow predefined values.
Before instantiating the oTable object, I build the value of "aoColumnDefs" (containing 'mRender') the following way:
[code]
(...)
// pre-build the list of options of the select box
for (var j=0; j
I have a question about Datatables in combination with TableTools:
In some columns of a table, I'm using 'mRender' to display the data as 'select boxes' (dropdown). The reason why I'm doing that, is that it allows users to edit the table, but they can't enter invalid values, since the select boxes only allow predefined values.
Before instantiating the oTable object, I build the value of "aoColumnDefs" (containing 'mRender') the following way:
[code]
(...)
// pre-build the list of options of the select box
for (var j=0; j
This discussion has been closed.
Replies
So I removed the mRender part from my code, and applied jEditable instead to the columns where I wanted a select box to show up.
Since jEditable creates the select element only when one clicks on a cell, and removes it as soon as editing is finished, those cells don't give problems anymore when exporting to PDF.
To prevent having to click too often (click onto cell to make selectbox show up, click again to get selectbox to drop down, click again to select a value!), I specified {"event": "mouseover"} in the jEditable parameters. That has the advantage of showing the user explicitly that the cell is editable, and there are now only two clicks needed to select a value (click to drop down and click to select).