How to customize jquery-datatables-editable select editors for individual row

I have been looking for some examples and solutions using the jquery-datatables-editable plugin and not had any luck. What I want to do is be able to set the editor for a column based on some identifier in that particular row. So for some rows a column may not be editable and other rows that column will have a select editor. I also need to have a column which always has a select editor which gathers data from a MySQL table but it will be filtered by a different parameter depending on the particular row.

Rough Example:

Col1          Col2            Col3            Col4
data1         null editor     select editor   select editor filter by 'a'
data2         select editor   null editor     select editor filter by 'b'
data3         select editor   null editor     select editor filter by 'b'
data4         null editor     select editor   select editor filter by 'a' 

I gather the table data from a MySQL database and render the HTML table using PHP so I can use this to place an id or class on the row, or on the table cells to identify which scenario is needed for each row. I am not sure where and how to get and pass the information to customise the type of editor that is used.

I have tried to search for this information and have found a couple of forum discussions on the DataTables forum which may relate to what I need - here and here in the third paragraph. My problem is that while I'm not exactly clueless I'm not finding them easy to understand and adapt to my problem (this level of jQuery is new to me). I'm hoping that there is a simple-ish solution and that I've either been searching poorly or it is so simple and obvious that nobody else has had trouble doing it.

Answers


Well what i did was to put the class editable on the td i wanted to make editable and then i used a class selector like this to make them editable:

$('td.editable', oTable.fnGetNodes()).editable( 

you should use classes for things like this one and not ids, because ids should be unique on the page


Need Your Help

How to upload file in chunks in ASP.NET using ng-Flow

.net file-upload chunks flow-js

I am trying to implement ng-flow https://github.com/flowjs/ng-flow for file upload. It upload files in chunk, I successfully set this on client but I am not sure how to handle file on backend insid...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.