Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Users might experience few discrepancies in Search results. We are working on this on our side. We apologize for the inconvenience it may have caused.
Cisco Employee

JavaScript function to add a row/record to Grid

How to add a row/record to a grid defined via service designer using Javascript? Are there any predefined functions/ Any workarounds

1 ACCEPTED SOLUTION

Accepted Solutions
New Member

Below is some sample

Below is some sample JavaScript you can use:

function AddRowToGrid(gridName) {

    var grid = nsServiceRequest.extjsGridList[gridName];
    var store = grid.getStore();
    grid.stopEditing();
    var newRow = store.getCount();
    var currentRecord = store.getAt(0);
    var myEntry= store.recordType;
    var newRowEntry= new myEntry();
    store.insert(newRow, newRowEntry);

}
2 REPLIES
New Member

Below is some sample

Below is some sample JavaScript you can use:

function AddRowToGrid(gridName) {

    var grid = nsServiceRequest.extjsGridList[gridName];
    var store = grid.getStore();
    grid.stopEditing();
    var newRow = store.getCount();
    var currentRecord = store.getAt(0);
    var myEntry= store.recordType;
    var newRowEntry= new myEntry();
    store.insert(newRow, newRowEntry);

}
Cisco Employee

Thank you so much derevan007.

Thank you so much derevan007. It is really helpful

181
Views
5
Helpful
2
Replies
CreatePlease to create content