My code:
toolbar: {
items: [
{
type: 'button', icon: 'ui-icon-plus', label: 'New', listener: function () {
// row data with default value
var rowData = {PROJ_Q: "0",ANX_PART_I: "",UOM_C: "",VNDR_ITEM_I: "",PRICE_A: "0.0000",
ANX_LIST_COST_A: "0.0000",DISC_COST_A: "0.0000",DISC_P: "0.0000",CUST_PART_I: "",
VNDR_COMMCODE_C: "",VNDR_LONG_ITEM_I: "",VNDR_UOM_C: "",ITEM_DESC_E: "",
VENDOR_I: " ",VNDR_CURRENCY_C: "",QUOTE_APPV_I: "",
EXT_COST_A: "0.0000",TOT_FORECAST_Q: "0",INVN_TRKG_F: false,STD_ITEM_I: "",
CUST_OWNED_F: false,INVN_TYPE_F: "Stock",CUST_SPECIFIC_F: false,CRIT_ITEM_F: false,
KIT_ITEM_F: false,METAL_FIRM_F: "",METAL_A: "0.0000",ITEM_LNGTH_P: "0.0000",
ITEM_WIDTH_P: "0.0000",ITEM_HT_P: "0.0000",WEIGHT_Q: "0",RTRN_POLICY_T: "",
FRT_SENSITIVE_F: false,VNDR_LINE_I: "0",LINE_I: "0",
vendorNumber: inputData["Vendor"], vendorListNumber: 0,
registrationNumber: "",
regType: inputData["RegType"],
PROJECT_I: project,
PROJECT_VENDOR_I: inputData["Vendor"],
QUOTE: inputData['Quote'],
RGSTR_TYPE_I: inputData["RegType"],
CONTRACT_I: contractNumber,
stockLocData:[]};
//append empty row at the end.
var rowIndx = this.addRow({ rowData: rowData, checkEditable: true });
this.goToPage({ rowIndx: rowIndx });
this.editFirstCellInRow({ rowIndx: rowIndx });
this.refresh();
}
},