Getting just first cell from selected row?
Getting just first cell from selected row?
Hello yet again!
So after several weeks of attempt-and-then-start-over-from-scratch hell....im close to getting this thing actually working correctly. Right now im able to select the row, gets correctly flagged, then when i hit the delete button, it calls my delete method and posts the row to the server via ajax to delete. Now the only wrinkle is that it posts the ENTIRE row, where as i just need the first cell. IE if my row was ID:1, name:theName, value:someValue, it passes back: '1theNamesomeValue' where i just need it to pass '1'. Ive been goin around everywhere looking for something to do the trick but so far no luck. Hopefully someone has a simple solution:
Main stuff:
[code]
$(document).ready(function(){
var oTable = $('#dataTable').dataTable({
"bProcessing": true,
"bJQueryUI": true,
"bPaginate": true,
"sPaginationType": "full_numbers",
"iDisplayLength": 10,
"aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
"sDom": 'pT<>rt',
"sAjaxSource": 'dataTable/getCmsGroupData',
"aoColumns": [
{ "mData": "id", "sTitle": "ID",
"fnRender": function (oObj) {
return '' + oObj.aData["id"] + '';
}},
{ "mData": "version", "sTitle":"Version" },
{ "mData": "name", "sTitle": "Name" },
{ "mData": "description", "sTitle": "Description"},
{ "mData": "notes", "sTitle": "Notes"},
],
"oTableTools": {
"aButtons": [
"select_all",
"select_none",
{
"sExtends": "text",
"sButtonText": "Create New Entry",
"fnClick": function ( nButton, oConfig, oFlash ) {
window.location = "cmsgroup_add";
}
}]
}
});
$("#dataTable tbody").click(function(event) {
$(oTable.fnSettings().aoData).each(function (){
$(this.nTr).removeClass('row_selected');
});
$(event.target.parentNode).addClass('row_selected');
});
function fnGetSelected( oTableLocal )
{
var aReturn = new Array();
var aTrs = oTableLocal.fnGetNodes();
for ( var i=0 ; i
So after several weeks of attempt-and-then-start-over-from-scratch hell....im close to getting this thing actually working correctly. Right now im able to select the row, gets correctly flagged, then when i hit the delete button, it calls my delete method and posts the row to the server via ajax to delete. Now the only wrinkle is that it posts the ENTIRE row, where as i just need the first cell. IE if my row was ID:1, name:theName, value:someValue, it passes back: '1theNamesomeValue' where i just need it to pass '1'. Ive been goin around everywhere looking for something to do the trick but so far no luck. Hopefully someone has a simple solution:
Main stuff:
[code]
$(document).ready(function(){
var oTable = $('#dataTable').dataTable({
"bProcessing": true,
"bJQueryUI": true,
"bPaginate": true,
"sPaginationType": "full_numbers",
"iDisplayLength": 10,
"aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
"sDom": 'pT<>rt',
"sAjaxSource": 'dataTable/getCmsGroupData',
"aoColumns": [
{ "mData": "id", "sTitle": "ID",
"fnRender": function (oObj) {
return '' + oObj.aData["id"] + '';
}},
{ "mData": "version", "sTitle":"Version" },
{ "mData": "name", "sTitle": "Name" },
{ "mData": "description", "sTitle": "Description"},
{ "mData": "notes", "sTitle": "Notes"},
],
"oTableTools": {
"aButtons": [
"select_all",
"select_none",
{
"sExtends": "text",
"sButtonText": "Create New Entry",
"fnClick": function ( nButton, oConfig, oFlash ) {
window.location = "cmsgroup_add";
}
}]
}
});
$("#dataTable tbody").click(function(event) {
$(oTable.fnSettings().aoData).each(function (){
$(this.nTr).removeClass('row_selected');
});
$(event.target.parentNode).addClass('row_selected');
});
function fnGetSelected( oTableLocal )
{
var aReturn = new Array();
var aTrs = oTableLocal.fnGetNodes();
for ( var i=0 ; i
This discussion has been closed.