I give up. I've been messing with this all day and can't make it work, so I'm coming to the forum. I've looked over many posts here, as I know this is a popular topic, but I just can't figure out how to make it work.
The objective is simple, I want to use the selectionAppearance:"checkbox" on my listGrid. Some rows the user is not subscribed to, so those rows should not be selectable. listGrid.findAll("continent", "Europe").setProperty("enabled", false); would have been a handy solution, but this listGrid does not use a datasource. Instead, it uses and RPC call. I've tried just about every thing I can think of, but nothing works. Can someone provide some direction? Thanks, S (using 7.0rc)
The objective is simple, I want to use the selectionAppearance:"checkbox" on my listGrid. Some rows the user is not subscribed to, so those rows should not be selectable. listGrid.findAll("continent", "Europe").setProperty("enabled", false); would have been a handy solution, but this listGrid does not use a datasource. Instead, it uses and RPC call. I've tried just about every thing I can think of, but nothing works. Can someone provide some direction? Thanks, S (using 7.0rc)
Code:
isc.ListGrid.create({
ID: "qsSearchResults",
loadingDataMessage:"Searching...",
width:820,
bodyBackgroundColor:"#FFFFFF",
alternateRecordStyles:true,
selectionAppearance:"checkbox",
height:700,
top:130,
left:160,
fields:[
{name:"subscribed", ID:"subscribed", title:" ", width:25, type:"boolean", prompt:"Subscription required", showIf:"false"},
{name:"company_code_dis", title:"Co Code", width:60, prompt:"Company code"},
{name:"stmt", title:"Type", width:50, prompt:"Insurance type"},
{name:"company_name", title:"Company Name", width:150, prompt:"Company name", showHover:true, hoverHTML:"return (record.subscribed)?record.company_name:'Subscription required'"},
{name:"ticker", title:"Ticker", width:45, prompt:"Ticker symbol"},
{name:"group_name", title:"Group Name", width:150, prompt:"Group name", showHover:true},
//{name:"group_code", title:"Grp Code", width:50, prompt:"Group code"},
{name:"state_of_domicile", title:"State", width:40, prompt:"State of domicile"},
{name:"annual_assets", title:"Annual Assets", width:100, type:"integer", prompt:"Annual Assets", formatCellValue:"isc.Format.toUSString(value)"},
{name:"annual_dpw", title:"Annual DPW", width:100, type:"integer", prompt:"Annual direct premiums written", formatCellValue:"isc.Format.toUSString(value)"},
{name:"data_as_of", title:"Data as of", width:80, type:"date", prompt:"Date this information was last updated"}
],
autoDraw:false
});
Code:
function quickSearch(value) {
var keyword = value;
isc.RPCManager.sendRequest({
containsCredentials: false,
actionURL:"/iap/nsGQSFind.go",
useSimpleHttp: false,
timeoutErrorMessage:"Operation timed out. Please try again.",
prompt:"Searching...",
showPrompt: true,
willHandleError:false,
params : {
queryString: keyword
},
callback : "displayResults(rpcResponse)"
});
}
function displayResults(rpcResponse) {
var status = rpcResponse.status;
switch(status)
{
case 0: //Search successful and results are there
qsSearchResults.setData(rpcResponse.data.resultList);
break;
case 1: //Search successful but 0 results
isc.warn(rpcResponse.data.errorMessage);
break;
case 2: //Search successful and Max result count reached
isc.warn(rpcResponse.data.errorMessage);
break;
case 3: //Error
isc.warn(rpcResponse.data.errorMessage);
break;
default:
isc.warn("Unknown error occured while searching. Please close this window and try again.");
}
qsSearchResults.show();
}
Comment