Reach out from a DataTable to the Fixed Column table and change some CSS
Reach out from a DataTable to the Fixed Column table and change some CSS
I'm using jEditable....I'm using the FixedColumn Extra/Plug-in...I'm in a cell in the DataTable and I've just updated the cell and I want to reach over to a cell in the FixedColumn area and change some CSS in an element in a cell on the same row...How do I do that?
Here's my jEditable code
[code]
function enterEditableFooCell(editableCell, cssclass, type, width) {
$(editableCell).editable(function (value, settings) {
return submitEditableFooCell(editableCell, value, settings);
},
{
cssclass: cssclass,
height: '14px',
loadtext: '',
onblur: 'submit',
placeholder: '',
tooltip: "Click to edit....",
type: type,
width: width
});
}
[/code]
I would like to change the CSS in an element in a cell over in the FixedColumn table whilst in the submitEditableFooCell function...so at that point I do have the cell(editableCell) from the DataTable avaliable....but I can't figure out how to jump over/(get to?) to the FixedColumn table
Edit: I think I have it figured out...Used jQuery to find the element, in this case an input element (styled as a button), by it's id...like so
[code]
var oTable = $('#atable').dataTable();
// find the row
var pos = oTable.fnGetPosition(editableCell);
// get the row data
var rowdata = oTable.fnGetData(pos[0]);
// use the row data to select the saveButton
var saveButton = $('#atableContainer #save_' + rowdata.FooID);
// Here's what the HTML for the saveButton looks like...of course
// they all have a unique id, so I was able to find them by the row's data id
[/code]
but I would still like to know if there's a more DataTablesish way to accomplish this?
Here's my jEditable code
[code]
function enterEditableFooCell(editableCell, cssclass, type, width) {
$(editableCell).editable(function (value, settings) {
return submitEditableFooCell(editableCell, value, settings);
},
{
cssclass: cssclass,
height: '14px',
loadtext: '',
onblur: 'submit',
placeholder: '',
tooltip: "Click to edit....",
type: type,
width: width
});
}
[/code]
I would like to change the CSS in an element in a cell over in the FixedColumn table whilst in the submitEditableFooCell function...so at that point I do have the cell(editableCell) from the DataTable avaliable....but I can't figure out how to jump over/(get to?) to the FixedColumn table
Edit: I think I have it figured out...Used jQuery to find the element, in this case an input element (styled as a button), by it's id...like so
[code]
var oTable = $('#atable').dataTable();
// find the row
var pos = oTable.fnGetPosition(editableCell);
// get the row data
var rowdata = oTable.fnGetData(pos[0]);
// use the row data to select the saveButton
var saveButton = $('#atableContainer #save_' + rowdata.FooID);
// Here's what the HTML for the saveButton looks like...of course
// they all have a unique id, so I was able to find them by the row's data id
[/code]
but I would still like to know if there's a more DataTablesish way to accomplish this?
This discussion has been closed.