Hello All,
I am new to Hands on table plugin. As per my study for the features, I have added “col_left” and “col_right” under drop-down. Also it shows the option in drop-down to insert the same but disabled.
I want to implement insert and remove a column with editable header in my project.
Please reply soon !!!
Thanks in advance!!!
Hi @j.rawaldhiya
If you would like to add options to add and remove columns via (as I understand) context menu, here’s how it should be set: http://jsfiddle.net/e59xrg0b/
syntax:contextMenu: ['col_left', 'col_right', 'remove_col']
but you should know that this option won’t work for object data sets. Then you would need to create custom options in the context menu. Here’s a demo for this situation: http://jsfiddle.net/1my0pct0/
Thanks for the Quickest reply!!
I have got your point of adding it in context menu, but the problem is, how can I edit the headers for the newly added columns.
The requirements for my project is we need a plugin through which a user can edit headers after clicking on the header cells, or we can provide a drop-down with some fix set of values as “header name” so the user can select from them.
@j.rawaldhiya you can use afterOnCellMouseDown
callback to get a click into header to (for example) display a window or a prompt, like here: http://jsfiddle.net/zfxryL32/
and then you can pass the index and a new name for a header to a colHeaders
as a function via updateSettings
.
Hi,
Thanks for the answer and the much needed help. Probably this will solve my problem. Will get back to you, if needed any more help.
Thanks Again!!!
You’re welcome @j.rawaldhiya
I’ll leave this ticket opened for 2 weeks if you would like to continue or the following tip won’t help.
Hi @aleksandra_budnik,
Do we have alternate options available to add column rendering functionality without using column property while initializing table grid.
Or in other words alternate ways to add HTML Tags inside columns without using column property.
Thanks
Hi @j.rawaldhiya
Can you share more details about this request
to add column rendering functionality
?
As far as I understand you can share some meta data via cells function as well. For example
cells: function(row, col){
if(col === 0){
//options for a first column
}
}
… but it depends on what you would like to do.