Hello i need the help to make the custom column.
i have a handsontable,
i need to make the column separate like “conditions” and “results”, if they want to add the condition column it should add and for results also,
here i giving the specifying the class name for those conditions and result, if i try to add the condition its taking the class of the result,
example: if i want add the same column like “C” how i can achive that …
thank you in advance
Hey @hanumanthareddy2345
so you want something like `Add column on the right/left" from the context menu https://handsontable.com/docs/6.2.2/demo-context-menu.html but the column should copy the content of the column that is selected?
ya… @aleksandra_budnik i want as you said … please help me to do … thank you for the great reply
here i am sharing the code snippet, https://jsfiddle.net/hanumantha_reddy/txsbq4oL/5/
i love the handsontable, thank you
To get this working you’d need.
- Create a custom context menu.
- You can use the default keys to add a columns
'col_left'
- Insert column left
'col_right'
- Insert column right
- Besides that, inside the custom option in the
callback
function you should run the setDataAtCell
method for each cell in new added column.
- To get the values that you need, call the
getDataAtCol
method. You can get the right index via getSelected
method.
instance.getSelected()[0][1] //returns column index
thank you for your kind info, please can i have the working jsfiddle example
As this is a custom implementation I could only propose development on demand, but this is a commercial service. If you’re interested I can schedule it for you.
can you update to this fiddle if possible i am new to the handsontable. what would be the commercial service charges ?
I have shared a scenario but developing it, debugging and testing would take around an hour or an hour and a half. If you already purchased a Handsontable PRO license and own an Extended Support plan we can develop it for you. Otherwise please contact me at support@handsontable.com for cost-time plan.
1 Like
is there any fiddle to ref to build that concept,
Sorry, I do not have any demo that that cover your case. Only a demo with an example on how to create a custom option of context menu You can find it here http://jsfiddle.net/oku5ypmr/
thank you for your kind support i’ll revert back you soon… thank you
Hi… @aleksandra_budnik hope your doing good,
i just done with the example as you suggested, but still i am not getting the complete idea, can you please update the jsfiddle http://jsfiddle.net/hanumantha_reddy/otLzcxr1/10/
actually when i add the column left/right, the changes are not applying but the styles are not applying accordingly, can you please help me out, i am struggling for this work to be done from last two weeks but i could’nt completed yet.
thank you @aleksandra_budnik
Welcome @hanumanthareddy2345
Thank you. Hope you’re doing good as well.
How the classes should get applied?
When I use ‘Add column on the left’ for the ‘Honda’ column I get new blank column and if I type anything inside the text turns red. As far I remember the column should get the same data, as ‘Honda’, right? But should it become red?
actually i am making the styles classes based on my dynamic data. from ‘Honda’ column i don’t have issues, the issue with the starting columns,(green color column)
i want add the same column like “A” to the left/right. with the same color like green it should take, the proble is,
example: i add the column to left of “A” column “india” that column becomes green color, but why the Toyota column becomes red[before it has green once i add the column it becomes red]. i want to make the toyota should be green, it should not change that class.
thank you @aleksandra_budnik for great support,
green color means my conditions and red color means my results, dynamically i am getting results as i want after that if i want to update, like adding conditions or results it should work,
example: i have 5 conditions in green color, if i add the column left/right using the context menu for the conditons it should add the one more green color column to the left/right of condition columns now it becomes total:6 green color columns, thats not happening, it always 5 green, if i add the column left/right the column will shift and it becomes red. please support for this @aleksandra_budnik.
for results, means red color columns i don’t have issues its creating the red color columns, like the same functionality i want for green color columns.
thank you @aleksandra_budnik
Here http://jsfiddle.net/AMBudnik/6Lyn5owz/
I got this working for “Insert column on the left”. I hope that you’d be able to make it work for the ‘right’ option as well.
hi @aleksandra_budnik i got the data to the next column left/right but i want the css class(color) of the selected column to be applied to the newly created column. now only the data it’s copied to the newly created column its not copied the css class.
thank you so much for the great help and time @aleksandra_budnik . your so clever.
Hello @aleksandra_budnik how are you …? hope your doing good, any updates or suggestions to this please let me know … thank you @aleksandra_budnik