Jessima / jquery-datatables-editable

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

Doesn't work with class-selected tables (e.g. $('.foo').dataTable().makeEditable) #47

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Initialising dataTable.makeEditable on a selector of a class rather than an id, 
e.g. '.foo', will make only the first table editable. I have attached a minimal 
example that shows this.

dataTable itself works on a class selector, datatables-editable should too.

I read 
http://jquery-datatables-editable.googlecode.com/svn/trunk/configure-dom.html - 
maybe the problem is in relation to the add/remove buttons. But in my use, I 
don't want to add/remove records, just edit the existing ones, so I have no 
buttons for those functions anyway. It shouldn't be assumed that people have 
the add/remove functionality, it works perfectly well for many purposes without 
it.

Original issue reported on code.google.com by brianna.laugher on 25 Jul 2011 at 7:36

Attachments:

GoogleCodeExporter commented 8 years ago
I found that it works if I do an id-based call for each table, e.g.

     $('#foo1').dataTable().makeEditable({
                             sUpdateURL: function(value, settings)
                                          {
                                          alert(value + $(this).attr('id') );
                                          return value;
                                          },
                                       });

     $('#foo2').dataTable().makeEditable({
                             sUpdateURL: function(value, settings)
                                          {
                                          alert(value + $(this).attr('id') );
                                          return value;
                                          },
                                       });

This is without adding any buttons or adding the button-related config to the 
initialisation. So... not sure why the class selector wouldn't work the same 
way.

Original comment by brianna.laugher on 26 Jul 2011 at 3:34

GoogleCodeExporter commented 8 years ago
I will investigate this. However if you are using same initialization on 
different tables then you are using identical UpdateData server page for 
updating values in differen tables. Why you need this as you have identical 
data managed with the sme function but in the different table.
This is not related to the issue you have reported - it just looks strange to 
me.

Original comment by joc...@gmail.com on 20 Aug 2011 at 8:41

GoogleCodeExporter commented 8 years ago
Well, I could make them the same table actually, but I had them as separate 
tables to insert a heading and break up the layout a bit. I am using an id on 
the cell to identify my data rather than row/column info. 

Original comment by brianna.laugher on 21 Aug 2011 at 5:59

GoogleCodeExporter commented 8 years ago
Hi,

Please use different ids instead of classes. I have tried this and there are 
few other issues that happens when I fix this.
For now this will be know bug because there are easy workaround (using 
different ids as an example).

Jovan

Original comment by joc...@gmail.com on 29 Sep 2011 at 6:10