add : function() {
var $grid = $("#off_hire_tab");
var data = $grid.pqGrid('option', 'dataModel.data');
var rowIndx = data.length;
if(data[0].isAdded == null)
{
var rowData = {
from_Date:'<div class="input-append" id="datepicker'+rowIndx+'" data-date="" data-date-format="dd/MM/yyyy hh:mm"><input type="text" value=" " id="fromDate'+rowIndx+'" style="width:160px;height:14px;width:140px;size:12px;font-family:Arial" readonly><span class="input-append add-on"><i data-date-icon="icon-calendar" data-time-icon="icon-time" class="icon-calendar"></i></span></div>',
to_Date:'<div class="input-append" id="datepick'+rowIndx+'" data-date="" data-date-format="dd/MM/yyyy hh:mm"><input type="text" value=" " id="toDate'+rowIndx+'" style="width:160px;height:14px;width:140px;size:12px;font-family:Arial" readonly><span class="input-append add-on"><i data-date-icon="icon-calendar" data-time-icon="icon-time" class="icon-calendar"></i></span></div>',
offhire_reason:"",
}
$grid.pqGrid("addRow", {rowData : rowData});
data[0].isAdded = "yes";
}
else{
$.jGrowl("New row already Exists", { sticky: false });
$.jGrowl.defaults.pool = 1;
exit;
}
}
This is my add function Query. Here if datas are there means i can add a new row. But if there is no row on the tab means i can't able to add. will you please help me how can i add a new row if there is no data also.