Our blazing fast Grid component built with pure JavaScript


Post by gregc »

Do you have any code snippets for inserting a row some place in the grid from a right click, like in Excel ?
I guess its a store add above a certain record by id, something like that?

Last edited by gregc on Mon Jan 11, 2021 7:17 pm, edited 2 times in total.

Post by mats »


Post by gregc »

Took me a while to get to the point of implementing this, In this case I was able to get the existing record, get the display sequence that I use in the grid, insert a new record, which triggers the AJAX call and returns a saved database record

function insertrow(params) {
	// row index in table
	var rowindex = params.cellData.row._index;
	// record clicked on 
	var existingrecord = params.record;
	// get the store and call 
	params.source._store.insert(rowindex, {fieldname:'New Field', displayseq: existingrecord.displayseq});
}

I really like working with this grid, it feels very powerful, thanks !


Post Reply