Editable plugin - column settings based on another columns values

Editable plugin - column settings based on another columns values

jlsjls Posts: 2Questions: 0Answers: 0
edited December 2011 in Plug-ins
I am new to DataTables and the editable plugin which I have working successfully. There are a couple of things that I would like to do and I can't seem to find any information on them.

1. I have two columns in my table (people & cars) and for each row only one of them will have data. If there is data it needs to be editable, if no data then not editable.

2. Based on which of those columns has data, another columns select list (activites) must be filtered differently. eg. if there is data in the people column activites must be filtered to those relevant to people - db is setup fine to deal with this I just need to know how to get the info to pass it for processing

Hopefully I am making some sense at this hour. If anyone has an idea or knows where I can find some help with this, I would really appreciate it. Thanks

[code]
.makeEditable({
sUpdateURL: '/apps/times.php',
'aoColumns': [
null,
null,
{
type: 'select',
onblur: 'cancel',
submit: 'Ok',
loadurl: 'select.php?table=jobs',
loadtype: 'GET',
cssclass: 'required'
},
{
placeholder : '',
type: 'select',
onblur: 'cancel',
submit: 'Ok',
loadurl: 'select.php?table=people',
loadtype: 'GET'
},
{
placeholder: '',
type: 'select',
onblur: 'cancel',
submit: 'Ok',
loadurl: 'select.php?table=cars',
loadtype: 'GET'
},
{ //activities
}

]
});
[/code]

Replies

  • jlsjls Posts: 2Questions: 0Answers: 0
    I have solved this problem.

    I was not understanding exactly how things fit together. By setting the columns to null in the code above. Then using the PHP code that builds my table to place distinguishing classes on the relevant table cells. I was then able to use the jEditable plugin directly to set the td elements to be editable in the way that I wanted.

    $('td.people', oTable.fnGetNodes()).editable('apps/times.php', { .... } etc.

    This way I set the class for each cell based on the type of data in the row, then set the type of selector based on the class. It works perfectly.
This discussion has been closed.