This post is related to my last post.
Requirement:
Hide a column permanently in a List Applet which is mandatory to expose on Applet.
Possible Solutions:
- Check Show in List property in applet list control. By checking this, column will be not be visible but available in Column Displayed option.
- Check Hidden property in applet list control. Using this, control available on BC but not in applet UI.
Issue with above solutions:
Thanks to my friend Ranjith for suggestions but may be because of security reasons with above solutions, control can’t be accessed from PM/PR which is my sole purpose.
JQuery solutions already discussed in my last post, which are already not working.So, only way out of this is to understand list applet implementation and tweak directly.
Final Solution:
We all know siebel OpenUI uses jqGrid plugin to render all list applets. Its always in my mind to explore it and take advantage of 3rd party jQuery plugin
First we need to understand this plugin, how it is working. You can find many online tutorials on this. Please check..
jqGrid Tutorial
Basic Structure:
$(‘#myGrid’).jqGrid({
…
colNames: [‘Manager’, ‘Name’, ‘HiddenSalary’],
colModel: [
{ name: ‘Manager’, editable: true },
{ name: ‘Price’, editable: true },
{ name: ‘HiddenSalary’, hidden: true , editable: true,
editrules: {edithidden:true}
}
],
…
};
Above piece of code will give a table with 3 columns and 3 rows. I can’t go in these details but we explore how to hide a column dynamically using jqgrid functions.
To hide a grid column:
jQuery(“#validGrid”).jqGrid(‘hideCol’,str);
where str is column name
Use this in Siebel Applet:
Now, big question is how to use grid methods in PM/PR of applet.
this.GetGrid();
Inside BindData() method of PR, this line will give grid object of a list applet. So, we can directly call all grid methods using this object. For example,
this.GetGrid().hideCol(‘ColName_to_hide’);
Now where we can find all these grid config details as in above sample grid code ???
this.GetGrid().jqGrid(“getGridParam”, “colNames”)
This line will give all grid config details but we have a twist here. We can’t use colName from here, use column name from colModel only. How to find that ??
this.GetGrid().jqGrid(“getGridParam”, “colModel”);
This line will give grid model details. Else you can find these names from get control list in PM/PR.
I know its complex one, so sharing snapshots as well.
Sample PR File:
JQGRID Details:
Column Hidden Successfully:
Hope it will help someone.
[su_divider]
@AskmeSiebel
11 comments for “Siebel OpenUI: Hide column in List Applet using JQGRID methods”