function PAOFormat(item) { var link = Number(item) + 0 ; return link; } cellTypeThe type of cell in the column. Allowable cell types include
- dojox.grid.cells.Bool
- dojox.grid.cells.Select
Solved! Go to Solution.
//Create data object to be used in store var data = { identifier: "OBJECTID", label: "LSData", items: items };var fldNameConvert = "fldConvertion"; var newItems = dojo.map(items, function(item) { var newItem = dojo.clone(item); newItem[fldNameConvert] = parseInt(newItem[fldNameConvert]); return newItem; }); var data = { identifier: "OBJECTID", label: "LSData", items: newItems };function PAOFormat(item) {
return dojo.string.pad(item, 3);
}<table dojotype="dojox.grid.DataGrid" jsid="grid1" id="grid1" autoheight="10" rowsperpage="160" rowselector="10px"> <thead> <tr> <th field="Address" width="160px">Address </th> <th field="PAO_FROM" formatter="PAOFormat" width="160px">PAO_FROM </th> </tr> </thead> </table>
//Create data object to be used in store
var data = {
identifier: "OBJECTID",
label: "LSData",
items: items
};
//Create data store and bind to grid.
store1 = new dojo.data.ItemFileReadStore({
data: data
});
console.debug(store1)
dijit.byId("keycontainer").selectChild(dijit.byId("results"));
grid1.setStore(store1); //Create data object to be used in store var data = { identifier: "OBJECTID", label: "LSData", items: items };var fldNameConvert = "fldConvertion"; var newItems = dojo.map(items, function(item) { var newItem = dojo.clone(item); newItem[fldNameConvert] = parseInt(newItem[fldNameConvert]); return newItem; }); var data = { identifier: "OBJECTID", label: "LSData", items: newItems };
//change the actual DATA used in the hidden colum used for sorting
//Add a padded string of the house number to the rest of the address, so order is 001, 002,010 rather than 1,10,2
//We then change the actual row DATA TO THIS NEW VALUE, JUST CHANGING WHAT IS DIPLAYED DOES NOT WORK
//Return 0 just to get something there that fill no space
function PAOFormat(item, rowIndex) {
var rowdata = this.grid.getItem(rowIndex);
var sortAddress = dojo.string.pad(item,3) + rowdata.Address;
rowdata.PAO_FROM[0] = sortAddress;
return 0;
}