2011-04-16 14:40:15 +00:00
/ * *
* global variable
* /
2011-03-17 03:39:05 +00:00
var XcatmonTableId = "XcatMonsettingTable" ;
var dataTables = new Object ( ) ;
2011-04-16 14:40:15 +00:00
/ * *
* set datatable
* /
2011-03-17 03:39:05 +00:00
function setDatatable ( id , obj ) {
dataTables [ id ] = obj ;
}
2011-04-16 14:40:15 +00:00
/ * *
* get datatable from the given id
* /
2011-03-17 03:39:05 +00:00
function getDatatable ( id ) {
return dataTables [ id ] ;
}
2011-04-16 14:40:15 +00:00
/ * *
* load xCAT monitor
* /
2010-08-04 08:49:20 +00:00
function loadXcatMon ( ) {
//find the xcat mon tab
var xcatMonTab = $ ( '#xcatmon' ) ;
2011-03-17 03:39:05 +00:00
xcatMonTab . append ( "<div id= xcatmonTable></div>" ) ;
2011-04-16 14:40:15 +00:00
//show the content of the table monsetting
2011-03-17 03:39:05 +00:00
$ . ajax ( {
url : 'lib/cmd.php' ,
dataType : 'json' ,
data : {
cmd : 'tabdump' ,
tgt : '' ,
args : 'monsetting' ,
msg : ''
} ,
success : loadXcatMonSetting
2010-08-04 08:49:20 +00:00
} ) ;
2011-03-17 03:39:05 +00:00
}
2011-04-16 14:40:15 +00:00
function loadXcatMonSetting ( data ) {
var apps ; //contain the xcatmon apps config
2011-03-17 03:39:05 +00:00
var rsp = data . rsp ;
2011-04-16 14:40:15 +00:00
var apps _flag = 0 ; //is the apps is stored?
var ping ; //contain the xcatmon ping-interval setting
2011-03-17 03:39:05 +00:00
var ping _flag = 0 ;
//create a infoBar
2011-04-16 14:40:15 +00:00
var infoBar = createInfoBar ( 'Click on a cell to edit. Click outside the table to write to the cell.<br>Once you are finished configuring the xCAT monitor, click on Apply.' ) ;
2011-03-17 03:39:05 +00:00
$ ( '#xcatmonTable' ) . append ( infoBar ) ;
2010-08-04 08:49:20 +00:00
2011-03-17 03:39:05 +00:00
//create xcatmonTable
var XcatmonTable = new DataTable ( XcatmonTableId ) ;
2010-08-04 08:49:20 +00:00
2011-03-17 03:39:05 +00:00
//create Datatable
var dTable ;
2011-04-16 14:40:15 +00:00
//create the xcatmonTable header
2011-03-17 03:39:05 +00:00
var header = rsp [ 0 ] . split ( "," ) ;
header . splice ( 3 , 2 ) ;
header . splice ( 0 , 1 ) ;
header [ 0 ] = "apps name" ;
header [ 1 ] = "configure" ;
header . push ( '<input type="checkbox" onclick="selectAllCheckbox(event,$(this))">' ) ;
2010-08-04 08:49:20 +00:00
2011-03-17 03:39:05 +00:00
header . unshift ( '' ) ;
2011-04-16 14:40:15 +00:00
XcatmonTable . init ( header ) ; //create the table header
2011-03-17 03:39:05 +00:00
2011-04-16 14:40:15 +00:00
//create container of original table contents
2011-03-17 03:39:05 +00:00
var origCont = new Array ( ) ;
2011-04-16 14:40:15 +00:00
origCont [ 0 ] = header ; //table header
2011-03-17 03:39:05 +00:00
//create contariner for new contents use for update the monsetting table
var newCont = new Object ( ) ;
2011-07-20 21:13:09 +00:00
newCont [ 0 ] = rsp [ 0 ] . split ( "," ) ; //table header
//create container for other monsetting lines not xcatmon
2011-03-17 03:39:05 +00:00
var otherCont = new Array ( ) ;
2011-04-16 14:40:15 +00:00
$ ( '#xcatmonTable' ) . append ( XcatmonTable . object ( ) ) ; //add table object
var m = 1 ; //the count for origCont
2011-03-17 03:39:05 +00:00
var n = 0 ;
2011-04-16 14:40:15 +00:00
for ( var i = 1 ; i < rsp . length ; i ++ ) { //get the apps and the ping-interval configure
var pos = rsp [ i ] . indexOf ( "xcatmon" ) ; //only check the xcatmon setting
if ( pos == 1 ) {
//get the useful info and add it to the page.
if ( ( rsp [ i ] . indexOf ( "apps" ) == - 1 ) && ( rsp [ i ] . indexOf ( "ping" ) == - 1 ) ) {
2011-03-17 03:39:05 +00:00
var cols = rsp [ i ] . split ( ',' ) ;
2011-04-16 14:40:15 +00:00
//pair the semicolon of the content
for ( var j = 0 ; j < cols . length ; j ++ ) {
if ( cols [ j ] . count ( '"' ) % 2 == 1 ) {
while ( cols [ j ] . count ( '"' ) % 2 == 1 ) {
2011-03-17 03:39:05 +00:00
cols [ j ] = cols [ j ] + "," + cols [ j + 1 ] ;
cols . splice ( j + 1 , 1 ) ;
}
}
2011-04-16 14:40:15 +00:00
cols [ j ] = cols [ j ] . replace ( new RegExp ( '"' , 'g' ) , '' ) ;
2011-03-17 03:39:05 +00:00
}
2011-04-16 14:40:15 +00:00
//remove the commend disable
2011-03-17 03:39:05 +00:00
cols . splice ( 3 , 2 ) ;
2011-04-16 14:40:15 +00:00
//remove the xcatmon
2011-03-17 03:39:05 +00:00
cols . splice ( 0 , 1 ) ;
cols . push ( '<input type="checkbox" name="' + cols [ 0 ] + '" title="Click this checkbox will add/remove the app from the configure apps value." />' ) ;
cols . unshift ( '<span class="ui-icon ui-icon-close" onclick="deleteRow1(this)"></span>' ) ;
2011-07-20 21:13:09 +00:00
//add the column tho the table
2011-03-17 03:39:05 +00:00
XcatmonTable . add ( cols ) ;
origCont [ m ++ ] = cols ;
2011-04-16 14:40:15 +00:00
} else {
if ( ! apps _flag ) { //check the apps setting
if ( rsp [ i ] . indexOf ( "apps" ) > - 1 ) { //check for is apps or not
apps = rsp [ i ] . split ( ',' ) ;
2011-03-17 03:39:05 +00:00
2011-04-16 14:40:15 +00:00
for ( var j = 0 ; j < apps . length ; j ++ ) { //pair the semicolon
if ( apps [ j ] . count ( '"' ) % 2 == 1 ) {
while ( apps [ j ] . count ( '"' ) % 2 == 1 ) {
apps [ j ] = apps [ j ] + "," + apps [ j + 1 ] ;
apps . splice ( j + 1 , 1 ) ;
2011-03-17 03:39:05 +00:00
}
}
apps [ j ] = apps [ j ] . replace ( new RegExp ( '"' , 'g' ) , '' ) ;
}
2011-04-16 14:40:15 +00:00
apps _flag = 1 ; //set the flag to 1 to avoid this subroute
2011-03-17 03:39:05 +00:00
}
}
2011-07-20 21:13:09 +00:00
2011-04-16 14:40:15 +00:00
//get into the ping setting subroute
if ( ! ping _flag ) {
2011-03-17 03:39:05 +00:00
//check the ping-interval config
2011-04-16 14:40:15 +00:00
if ( rsp [ i ] . indexOf ( "ping-interval" ) > - 1 ) {
2011-03-17 03:39:05 +00:00
ping = rsp [ i ] . split ( ',' ) ;
2011-04-16 14:40:15 +00:00
//pair the semicolon
for ( var j = 0 ; j < ping . length ; j ++ ) {
if ( ping [ j ] . count ( '"' ) % 2 == 1 ) {
while ( ping [ j ] . count ( '"' ) % 2 == 1 ) {
2011-03-17 03:39:05 +00:00
ping [ j ] = ping [ j ] + "," + ping [ j + 1 ] ;
ping . splice ( j + 1 , 1 ) ;
}
}
ping [ j ] = ping [ j ] . replace ( ( new RegExp ( '"' , 'g' ) ) , '' ) ;
}
ping _flag = 1 ;
}
}
}
2011-04-16 14:40:15 +00:00
} else if ( pos != 1 ) {
//the other monitor in the monsetting table
2011-03-17 03:39:05 +00:00
var otherCols = rsp [ i ] . split ( ',' ) ;
2011-04-16 14:40:15 +00:00
for ( var k = 0 ; k < otherCols . length ; k ++ ) {
if ( otherCols [ k ] . count ( '"' ) % 2 == 1 ) {
while ( otherCols [ k ] . count ( '"' ) % 2 == 1 ) {
2011-03-17 03:39:05 +00:00
otherCols [ k ] = otherCols [ k ] + "," + otherCols [ k + 1 ] ;
otherCols . splice ( k + 1 , 1 ) ;
}
}
otherCols [ k ] = otherCols [ k ] . replace ( new RegExp ( '"' , 'g' ) , '' ) ;
}
//add the rows to the otherCont.
otherCont [ n ++ ] = otherCols ;
}
}
2011-04-16 14:40:15 +00:00
//if the apps is not in the monsetting table.Then create the default apps row.
//when saving the changes,add the row to the table.
2011-03-17 03:39:05 +00:00
if ( ! apps _flag ) {
apps = rsp [ 0 ] . split ( ',' ) ;
apps [ 0 ] = "xcatmon" ;
apps [ 1 ] = "apps" ;
apps [ 2 ] = "" ;
apps [ 3 ] = "" ;
apps [ 4 ] = "" ;
2011-04-16 14:40:15 +00:00
}
2011-03-17 03:39:05 +00:00
2011-04-16 14:40:15 +00:00
//if the ping-interval is not in the monsetting table.Then create the default ping-interval row.
//when saving the changes,add the row to the table.
2011-03-17 03:39:05 +00:00
if ( ! ping _flag ) {
ping = rsp [ 0 ] . split ( ',' ) ;
ping [ 0 ] = "xcatmon" ;
ping [ 1 ] = "ping-interval" ;
2011-04-16 14:40:15 +00:00
//the default ping-interval setting is 5
2011-03-17 03:39:05 +00:00
ping [ 2 ] = "5" ;
ping [ 3 ] = "" ;
ping [ 4 ] = "" ;
2010-08-04 08:49:20 +00:00
}
2011-03-17 03:39:05 +00:00
2011-04-16 14:40:15 +00:00
//set the checkbox to be true according to the apps
2011-03-17 03:39:05 +00:00
var checked = apps [ 2 ] . split ( ',' ) ;
2011-04-16 14:40:15 +00:00
for ( var i = 0 ; i < checked . length ; i ++ ) {
//set the selcet checkbox to true
2011-03-17 03:39:05 +00:00
$ ( "input:checkbox[name=" + checked [ i ] + "]" ) . attr ( 'checked' , true ) ;
2011-04-16 14:40:15 +00:00
for ( var j = 0 ; j < origCont . length ; j ++ ) {
//set the origCont's checkbox to true
if ( origCont [ j ] [ 1 ] == checked [ i ] ) {
2011-03-17 03:39:05 +00:00
origCont [ j ] . splice ( 3 , 1 ) ;
origCont [ j ] . push ( '<input type="checkbox" name="' + origCont [ j ] [ 1 ] + '" title="Click this checkbox will add/remove the app from the configure apps value." checked=true/>' ) ;
}
}
2010-08-04 08:49:20 +00:00
2011-03-17 03:39:05 +00:00
}
$ ( ":checkbox" ) . tooltip ( ) ;
/ *
$ ( ':checkbox' ) . hover (
function ( ) {
$ ( this ) . append ( $ ( "<span>***</span>" ) ) ;
} ,
function ( ) {
$ ( this ) . find ( "span:last" ) . remove ( ) ;
}
) ;
* /
//make the table editable
$ ( '#' + XcatmonTableId + ' td:not(td:nth-child(1),td:last-child)' ) . editable (
2011-04-16 14:40:15 +00:00
function ( value , settings ) {
var colPos = this . cellIndex ;
var rowPos = dTable . fnGetPosition ( this . parentNode ) ;
dTable . fnUpdate ( value , rowPos , colPos ) ;
return ( value ) ;
2011-03-17 03:39:05 +00:00
} , {
2011-04-16 14:40:15 +00:00
onblur : 'submit' ,
type : 'textarea' ,
placeholder : ' ' ,
height : '30px'
2011-03-17 03:39:05 +00:00
}
) ;
2011-04-16 14:40:15 +00:00
2011-03-17 03:39:05 +00:00
//save the datatable
dTable = $ ( '#' + XcatmonTableId ) . dataTable ( ) ;
2011-04-16 14:40:15 +00:00
//set the datatable to the global variables datatables
2011-03-17 03:39:05 +00:00
setDatatable ( XcatmonTableId , dTable ) ;
2010-08-04 08:49:20 +00:00
2011-03-17 03:39:05 +00:00
//create button bar
var addBar = $ ( '<div align="center"></div>' ) ;
$ ( '#xcatmon' ) . append ( addBar ) ;
2011-04-16 14:40:15 +00:00
//create the button add row
2011-03-17 03:39:05 +00:00
var addRowBtn = createButton ( 'Add row' ) ;
2011-04-16 14:40:15 +00:00
//add the button to the page
2011-03-17 03:39:05 +00:00
addBar . append ( addRowBtn ) ;
2011-04-16 14:40:15 +00:00
//create the button apply
2011-03-17 03:39:05 +00:00
var ApplyBtn = createButton ( 'Apply' ) ;
2011-04-16 14:40:15 +00:00
//add the apply button to the page
2011-03-17 03:39:05 +00:00
addBar . append ( ApplyBtn ) ;
2011-04-16 14:40:15 +00:00
//create the button Cancel
2011-03-17 03:39:05 +00:00
var CancelBtn = createButton ( 'Cancel' ) ;
2011-04-16 14:40:15 +00:00
//add the cancel to the page
2011-03-17 03:39:05 +00:00
addBar . append ( CancelBtn ) ;
2011-04-16 14:40:15 +00:00
//button click function
2011-03-17 03:39:05 +00:00
//create a empty row
2011-04-16 14:40:15 +00:00
addRowBtn . bind ( 'click' , function ( event ) {
//create the container of the new row
2011-03-17 03:39:05 +00:00
var row = new Array ( ) ;
2011-04-16 14:40:15 +00:00
//add the delete button to the row
2011-03-17 03:39:05 +00:00
row . push ( '<span class="ui-icon ui-icon-close" onclick="deleteRow1(this)"></span>' ) ;
2011-04-16 14:40:15 +00:00
//add the xcatmon
//add the contain of the setting
for ( var i = 0 ; i < header . length - 2 ; i ++ ) {
2011-03-17 03:39:05 +00:00
row . push ( '' ) ;
}
2011-04-16 14:40:15 +00:00
//add the checkbox
2011-03-17 03:39:05 +00:00
row . push ( '<input type="checkbox" name="' + row [ 2 ] + '" title="Click this checkbox will add/remove the app from the configure apps value."/>' ) ;
2011-04-16 14:40:15 +00:00
//get the datatable of the table
2011-03-17 03:39:05 +00:00
var dTable = getDatatable ( XcatmonTableId ) ;
2011-04-16 14:40:15 +00:00
//add the new row to the datatable
2011-03-17 03:39:05 +00:00
dTable . fnAddData ( row ) ;
2011-04-16 14:40:15 +00:00
//make the datatable editable
2011-03-17 03:39:05 +00:00
$ ( ":checkbox[title]" ) . tooltip ( ) ;
$ ( '#' + XcatmonTableId + ' td:not(td:nth-child(1),td:last-child)' ) . editable (
function ( value , settings ) {
2011-04-16 14:40:15 +00:00
var colPos = this . cellIndex ;
var rowPos = dTable . fnGetPosition ( this . parentNode ) ;
dTable . fnUpdate ( value , rowPos , colPos ) ;
return ( value ) ;
2011-03-17 03:39:05 +00:00
} , {
2011-04-16 14:40:15 +00:00
onblur : 'submit' ,
type : 'textarea' ,
placeholder : ' ' ,
height : '30px'
2010-08-04 08:49:20 +00:00
}
2011-03-17 03:39:05 +00:00
) ;
2010-08-04 08:49:20 +00:00
} ) ;
2011-03-17 03:39:05 +00:00
2011-04-16 14:40:15 +00:00
/ * *
* apply button
*
* the Apply button is used to store the contain of the table in the page to
* the monsetting table on the MN .
* /
ApplyBtn . bind ( 'click' , function ( event ) {
//get the datatable of the page
2011-03-17 03:39:05 +00:00
var dTable = getDatatable ( XcatmonTableId ) ;
2011-04-16 14:40:15 +00:00
//get the rows of the datatable
2011-03-17 03:39:05 +00:00
var dRows = dTable . fnGetNodes ( ) ;
var count = 0 ;
2011-04-16 14:40:15 +00:00
//create the new container of the apps' value.
2011-03-17 03:39:05 +00:00
var appValue = "" ;
var tableName = "monsetting" ;
var tmp ;
var tmp1 ;
2011-04-16 14:40:15 +00:00
var closeBtn = createButton ( "close" ) ;
//get the contain of the rows
2011-03-17 03:39:05 +00:00
for ( var i = 0 ; i < dRows . length ; i ++ ) {
2011-04-16 14:40:15 +00:00
if ( dRows [ i ] ) {
//get the columns fo the row
2011-03-17 03:39:05 +00:00
var cols = dRows [ i ] . childNodes ;
2011-04-16 14:40:15 +00:00
//create the container of the new column
2011-03-17 03:39:05 +00:00
var vals = new Array ( ) ;
2011-04-16 14:40:15 +00:00
for ( var j = 1 ; j < cols . length - 1 ; j ++ ) {
//get the value of every column(except the first and the last.why ? .ni dong de)
2011-03-17 03:39:05 +00:00
var val = cols . item ( j ) . firstChild . nodeValue ;
2011-04-16 14:40:15 +00:00
if ( val == ' ' ) {
2011-03-17 03:39:05 +00:00
vals [ j - 1 ] = '' ;
2011-04-16 14:40:15 +00:00
} else {
2011-03-17 03:39:05 +00:00
vals [ j - 1 ] = val ;
}
}
2011-04-16 14:40:15 +00:00
//prepare another space for the array/
2011-03-17 03:39:05 +00:00
var vals _orig = new Array ( ) ;
2011-04-16 14:40:15 +00:00
//copy the data from vals to vals_orig
for ( var p = 0 ; p < 2 ; p ++ ) {
var val = vals [ p ] ;
vals _orig [ p ] = val ;
}
2011-03-17 03:39:05 +00:00
vals . push ( "" ) ;
vals . push ( "" ) ;
vals . unshift ( "xcatmon" ) ;
2011-04-16 14:40:15 +00:00
//stored the new column to the newCont
2011-03-17 03:39:05 +00:00
newCont [ i + 1 ] = vals ;
2011-04-16 14:40:15 +00:00
//check the checkbox of the row and add different checkbox to the orignCont
//for the cancle button
if ( cols . item ( cols . length - 1 ) . firstChild . checked ) {
vals _orig . push ( '<input type="checkbox" name="' + vals _orig [ 0 ] + '" title="Click this checkbox will add/remove the app from the configure apps value." checked=true/>' ) ;
} else {
vals _orig . push ( '<input type="checkbox" name="' + vals _orig [ 0 ] + '" title="Click this checkbox will add/remove the app from the configure apps value."/>' ) ;
}
//push the delete button to the row
2011-03-17 03:39:05 +00:00
vals _orig . unshift ( '<span class="ui-icon ui-icon-close" onclick="deleteRow1(this)"></span>' ) ;
2011-04-16 14:40:15 +00:00
//add the row to the orignCont
2011-03-17 03:39:05 +00:00
origCont [ i + 1 ] = vals _orig ;
//tmp1=origCont;
//tmp=newCont;
count = i + 1 ;
2011-04-16 14:40:15 +00:00
//check the checkbox fo everyrow for merging the appName to the apps values
if ( cols . item ( cols . length - 1 ) . firstChild . checked ) {
//the new value for the apps.get the name fo every app.
2011-03-17 03:39:05 +00:00
appValue = appValue . concat ( cols . item ( 2 ) . firstChild . nodeValue + "," ) ;
}
}
}
2011-04-16 14:40:15 +00:00
2011-03-17 03:39:05 +00:00
count ++ ;
2011-04-16 14:40:15 +00:00
//delete the last "," of the apps value
2011-03-17 03:39:05 +00:00
appValue = appValue . substring ( 0 , ( appValue . length - 1 ) ) ;
apps [ 2 ] = appValue ;
2011-04-16 14:40:15 +00:00
//newCont add the apps row
2011-03-17 03:39:05 +00:00
newCont [ count ++ ] = apps ;
2011-04-16 14:40:15 +00:00
//newCont add the ping-interval row
2011-03-17 03:39:05 +00:00
newCont [ count ++ ] = ping ;
//tmp=otherCont;
2011-04-16 14:40:15 +00:00
//add the other monitor setting of the mosetting
2011-03-17 03:39:05 +00:00
for ( var j = 0 ; j < otherCont . length ; j ++ ) {
newCont [ count ++ ] = otherCont [ j ] ;
}
//tmp=otherCont.length;
//tmp1=newCont;
setDatatable ( XcatmonTableId , dTable ) ;
2011-04-16 14:40:15 +00:00
//create the save dialog
2011-03-22 11:49:27 +00:00
var dialogSave = $ ( '<div id="saveDialog" align="center">saving the configuration </div>' ) ;
dialogSave . append ( createLoader ( ) ) ;
addBar . append ( dialogSave ) ;
2011-04-16 14:40:15 +00:00
//open the dialog..modal is true
2011-03-22 11:49:27 +00:00
$ ( "#saveDialog" ) . dialog ( { modal : true } ) ;
2011-04-16 14:40:15 +00:00
//hide the cross...
2011-03-22 11:49:27 +00:00
$ ( '.ui-dialog-titlebar-close' ) . hide ( ) ;
2011-04-16 14:40:15 +00:00
//put the table name and the contain to the tabRestore.php
2010-08-04 08:49:20 +00:00
$ . ajax ( {
2011-03-17 03:39:05 +00:00
type : 'POST' ,
url : 'lib/tabRestore.php' ,
2010-08-04 08:49:20 +00:00
dataType : 'json' ,
data : {
2011-03-17 03:39:05 +00:00
table : tableName ,
cont : newCont
2010-08-04 08:49:20 +00:00
} ,
2011-04-16 14:40:15 +00:00
success : function ( data ) {
//empty the dialog.add the close button
2011-03-22 11:49:27 +00:00
$ ( "#saveDialog" ) . empty ( ) . append ( '<p>The Configure has saved!</p>' ) ;
$ ( "#saveDialog" ) . append ( closeBtn ) ;
2010-08-04 08:49:20 +00:00
}
2011-03-17 03:39:05 +00:00
2010-08-04 08:49:20 +00:00
} ) ;
2011-04-16 14:40:15 +00:00
//close button function
closeBtn . bind ( 'click' , function ( event ) {
$ ( "#saveDialog" ) . dialog ( "distroy" ) ;
$ ( "#saveDialog" ) . remove ( ) ;
} ) ;
2010-08-04 08:49:20 +00:00
2011-04-16 14:40:15 +00:00
//clear the newCont
2011-03-17 03:39:05 +00:00
newCont = null ;
2011-04-16 14:40:15 +00:00
newCont = new Object ( ) ;
//just for tmp=newCont;
2011-03-17 03:39:05 +00:00
newCont [ 0 ] = rsp [ 0 ] . split ( "," ) ;
2011-04-16 14:40:15 +00:00
} ) ;
2011-03-17 03:39:05 +00:00
2011-04-16 14:40:15 +00:00
/ * *
* undo button
* /
CancelBtn . bind ( 'click' , function ( event ) {
//get the datatable of the page
2011-03-17 03:39:05 +00:00
var dTable = getDatatable ( XcatmonTableId ) ;
2011-04-16 14:40:15 +00:00
//clear the datatable
2011-03-17 03:39:05 +00:00
dTable . fnClearTable ( ) ;
2011-04-16 14:40:15 +00:00
//add the contain of the origCont to the datatable
for ( var i = 1 ; i < origCont . length ; i ++ ) {
2011-03-17 03:39:05 +00:00
dTable . fnAddData ( origCont [ i ] , true ) ;
}
$ ( ":checkbox[title]" ) . tooltip ( ) ;
2011-04-16 14:40:15 +00:00
$ ( '#' + XcatmonTableId + ' td:not(td:nth-child(1),td:last-child)' ) . editable (
function ( value , settings ) {
var colPos = this . cellIndex ;
var rowPos = dTable . fnGetPosition ( this . parentNode ) ;
dTable . fnUpdate ( value , rowPos , colPos ) ;
return ( value ) ;
2011-03-17 03:39:05 +00:00
} , {
2011-04-16 14:40:15 +00:00
onblur : 'submit' ,
type : 'textarea' ,
placeholder : ' ' ,
height : '30px'
} ) ;
} ) ;
2010-08-04 08:49:20 +00:00
}
2011-04-16 14:40:15 +00:00
/ * *
* delete a row from the table
* /
2011-03-17 03:39:05 +00:00
function deleteRow1 ( obj ) {
//var tableid=$(obj).parent().parent().parent().parent().attr('id');
var dTable = getDatatable ( XcatmonTableId ) ;
var rows = dTable . fnGetNodes ( ) ;
var tgtRow = $ ( obj ) . parent ( ) . parent ( ) . get ( 0 ) ;
for ( var i in rows ) {
2011-04-16 14:40:15 +00:00
if ( rows [ i ] == tgtRow ) {
2011-03-17 03:39:05 +00:00
dTable . fnDeleteRow ( i , null , true ) ;
break ;
}
2010-08-04 08:49:20 +00:00
}
}