Checkbox in Listgrid
Hi ,
I want to have checkbox in my listgrid and also in column head I want Selectall checkbox, and by selecting this checkbox will select all the checkbox in the listgrid, also the scrollbar are visiable in pane which also need to be solved, below is my code,
<script>
var swidth=document.body.clientWidth-202;
var sheight=document.body.clientHeight-95;
var count=1;
var scount=1;
isc.TabSet.create({
ID: “topTabSet”,
tabBarPosition: “top”,
width:swidth,
top:115,left:200,height:sheight,
tabs: [
{title: “All (19)”,pane:isc.ViewLoader.create({top:100,viewURL:“TRQ.js”,loadingMessage:“Loading Grid..”})}
],
removeTabs : function (tabs) {
this.Super(“removeTabs”, arguments);
count=count-1;
scount=scount-1;
filterbut.show();
}
});
//var swidth1=screen.width-157;
isc.Button.create({
left:document.body.clientWidth-150, top:115,autoFit: true,
title:"Search",ID:"searchbut"
})
isc.Button.create({
left:document.body.clientWidth-140, top:140,autoFit: true,
title:"SHOW FILTER",ID:"filterbut",
display:"hidden",
click:function ()
{
if(filterbut.title=="SHOW FILTER")
{
filterbut.setTitle("CLEAR FILTER");
listGrid.setShowFilterEditor(true);
listGrid.redraw ();
}
else{
filterbut.setTitle("SHOW FILTER");
listGrid.setShowFilterEditor(false);
listGrid.redraw ();
}
}
})
isc.Button.create({
left:document.body.clientWidth-75, top:115,autoFit: true,
title:"Refresh",ID:"refereshbut"
})
function resizewin()
{
swidth=document.body.clientWidth-202;
sheight=document.body.clientHeight-395;
topTabSet.setWidth(swidth); topTabSet.setHeight(sheight); searchbut.setLeft(document.body.clientWidth-150); filterbut.setLeft(document.body.clientWidth-140); refereshbut.setLeft(document.body.clientWidth-75);
}
function newtab(val1)
{
if(count<2)
{count=count+1;
topTabSet.addTab({
title: val1,canClose: true,
pane: isc.Canvas.create({ autoDraw:false,
contents:"Contents of "+ val1} )}); topTabSet.selectTab(topTabSet.tabs.length-1);
filterbut.hide();
}
}
function searchtab(val1)
{
scount=scount+1;
if(scount<3)
{
topTabSet.addTab({
title: val1,canClose: true,
pane:isc.HTMLFlow.create({top:100,contentsURL:"Search1.htm",loadingMessage:"Loading Grid.."})}); topTabSet.selectTab(topTabSet.tabs.length-1);
filterbut.hide();
}
}
//TRQ.js start//
isc.ResultSet.create({
ID:"resultSetTRQ",
dataSource:"TRQDataDS",
// replace with first five rows, eg, via dataSource.fetchData() call
initialData: [],
initialLength:5,
resultSize:5,
// avoid the totalRows ever being set to the actual dataset size
transformData : function (newDate, dsResponse) {
dsResponse.totalRows = this.getLength();
if(dsResponse.totalRows==1000)
{
dsResponse.totalRows=5;
}
},
updateLength : function () {
this.logWarn("scrolled fired, visibleRows: " + listGridTRQ.getVisibleRows());
var currentLength = resultSetTRQ.getLength();
if(currentLength<60)
{
if (listGrid.getVisibleRows()[1] >= currentLength-1)
{
resultSetTRQ.setFullLength(currentLength +5);
resultSetTRQ.getRange(currentLength, currentLength + 5);
}
}
}
})
isc.ListGrid.create({
ID:"listGridTRQ",
showFilterEditor:false,
data:resultSetTRQ,
recordClick: "newtab(record.TRQID)"
/*getCellCSSText: function (record, rowNum, colNum)
{
if (this.getFieldName(colNum) == "IMID")
{
return "font-weight:bold; color:red;";
}
}*/
})
resultSetTRQ.observe(listGridTRQ.body, "scrolled", "observer.updateLength()");
//TRQ.js end//
//TRQDataDS start///
isc.DataSource.create({
ID: "TRQDataDS",
fields:[
{name:“sel”,title:“<input type=checkbox onclick=test(‘selectall’)>”,emptyCellValue:“<input type=checkbox onclick=test(record.TRQID)>”,width:30},
{name:“TRQID”, title:“TRQ ID”,type: “integer”,align:“left”},
{name:“ErrorDesc”, title:“Error<br>Description”},
{name:“Errorupdate”, title:“Error<br>update”}
],
clientOnly: true,
testData: TRQData
})
//TRQDataDS end///
///DATA
TRQData = [
{
TRQID:1268567,
ErrorDesc: “Fatal Exception Occoured”,
Errorupdate:“Tue 7-Oct-07<br>16:12”
},
{
TRQID:1268568,
ErrorDesc: “Fatal Exception Occoured”,
Errorupdate:“Tue 7-Oct-07<br>16:12”
},
{
TRQID:1268569,
ErrorDesc: “Fatal Exception Occoured”,
Errorupdate:“Tue 7-Oct-07<br>16:12”
},
{
TRQID:1268570,
ErrorDesc: “Fatal Exception Occoured”,
Errorupdate:“Tue 7-Oct-07<br>16:12”
},
{
TRQID:1268571,
ErrorDesc: “Fatal Exception Occoured”,
Errorupdate:“Tue 7-Oct-07<br>16:12”
},
{
TRQID:1268572,
ErrorDesc: “Fatal Exception Occoured”,
Errorupdate:“Tue 7-Oct-07<br>16:12”
},
{
TRQID:1268573,
ErrorDesc: “Fatal Exception Occoured”,
Errorupdate:“Tue 7-Oct-07<br>16:12”
},
{
TRQID:1268574,
ErrorDesc: “Fatal Exception Occoured”,
Errorupdate:“Tue 7-Oct-07<br>16:12”
},
{
TRQID:1268575,
ErrorDesc: “Fatal Exception Occoured”,
Errorupdate:“Tue 7-Oct-07<br>16:12”
},
{
TRQID:1268576,
ErrorDesc: “Fatal Exception Occoured”,
Errorupdate:“Tue 7-Oct-07<br>16:12”
}
]
</script>