theoreticsinc / jquery-datatables-editable

Automatically exported from code.google.com/p/jquery-datatables-editable
0 stars 0 forks source link

Customise editors by row #82

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I really love this plugin and have enjoyed setting it up.  I am having trouble 
with some more advanced functionality and am wondering first if it is possible 
and if there are any examples around that I could follow.

I have setup and customised editors for each column, some null, some default 
and some select.

My problem is that depending on the data in any particular row I need to 
display editors differently.

Example:
Col1    Col2    Col3    Col4
data1   null    select  select(filtered by a param)
data2   select  null    select(filtered by a different param)
data2   select  null    select(filtered by a different param)
data1   select  null    select(filtered by a param)

Is there a way to customise a column's editor based on the id of the cell, or 
by an id or class on any of the related elements for that row?

I have tried really hard to search an answer to this question here and other 
places and have only found one reference that may come close.
http://www.datatables.net/forums/discussion/6011/jeditable-facepalming./p1
...in the third paragraph of the original post of that link. However on 
reviewing the code I'm finding it a bit difficult to understand.  Please let me 
know if I am on the right track with this and I will try harder to understand 
it.
Thanks

Original issue reported on code.google.com by jemmalsh...@gmail.com on 18 Dec 2011 at 10:04

GoogleCodeExporter commented 8 years ago
Apologies, I think I may have entered this incorrectly but cannot see how to 
edit or update it.  I appreciate any help you can give even if it is to give me 
somewhere else to search.
Thanks

Original comment by jemmalsh...@gmail.com on 18 Dec 2011 at 10:20

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I have solved this problem by placing classes on the relevant table cells and 
then targeting jEditable plugin directly from a jquery selector.  
Thanks

Original comment by jemmalsh...@gmail.com on 19 Dec 2011 at 12:39

GoogleCodeExporter commented 8 years ago
Sorry, but i have not checked these message earlier. Custom editing per rows is 
not supported, but I'm glad that you have found a way to resolve it.

Jovan

Original comment by joc...@gmail.com on 9 Feb 2012 at 9:25