Need of Serial number column in the data grid view

1
Hi id do want to add a serail number against each row , how to add extra column of Serial Number in data grid type of view .  
asked
2 answers
1

You can add an autonumber field to your entity. Note though that deleting objects will not free that number. If you need the numbers to always have no gap you need to create that number yourself.

Regards,

Ronald

 

answered
0

Probably going to get flogged for this again, try this, uses no database stuff

var YOURGRIDCLASSSELECTOR='.mx-grid';
var wid=dijit.byNode(dojo.query(YOURGRIDCLASSSELECTOR)[0])
if(wid!=null){
	if(wid.addRowIdx==null){
		wid.addRowIdx=function(colIdx){
			this._gridRowNodes.forEach(
				function(r,ridx){
					dojo.query('td',r)[colIdx].innerHTML=wid._dataSource._offset+ridx;
				}
			)
		}
		wid.refreshGridOrig=wid.refreshGrid;
		wid.refreshGrid=function(){
			this.addRowIdx(0);
			this.refreshGridOrig();
		}
		wid.addRowIdx(0);
	}else{
		mx.ui.warning(YOURGRIDCLASSSELECTOR+" found but already patched");
	}
}else{
	mx.ui.error(YOURGRIDCLASSSELECTOR+" not found");
}

Ads another function on the grid instance and addRowIdx can be manipulated to replace the content of a specified collumn, so you just have to create a dummy column, uses pagination to compute the row idx, remains monotonic increasing with no gaps

answered