This will hide the columns if there is no data in the column field on the first row.
Code:
isc.ListGrid.create({ ID: "shopProdListGrid", width: "100%", height: "95%", alternateRecordStyles: true, sortField: 1, dataPageSize: 30, drawAheadRatio: 4, listEndEditAction: "next", autoSaveEdits: true, autoFetchData: true, confirmDiscardEdits: true, canSelectAll: false, dataSource: shopProdRestDataSource, editEvent: "click", selectCellTextOnClick: true, dataArrived: function(startRow, endRow){//Get the column values from the forst row var { value_0, value_1, value_2, value_3, value_4 } = shopProdListGrid.getCellRecord(startRow); if (!value_0) {shopProdListGrid.hideField("key_0"); shopProdListGrid.hideField("value_0");} if (!value_1) {shopProdListGrid.hideField("key_1"); shopProdListGrid.hideField("value_1");} if (!value_2) {shopProdListGrid.hideField("key_2"); shopProdListGrid.hideField("value_2");} if (!value_3) {shopProdListGrid.hideField("key_3"); shopProdListGrid.hideField("value_3");} if (!value_4) {shopProdListGrid.hideField("key_4"); shopProdListGrid.hideField("value_4");}}, });
Leave a comment: