Hiding entire columns in Query (grid)

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 1828
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Hiding entire columns in Query (grid)

Post by Jaymer »

see this pic:
hide columns.PNG
hide columns.PNG (14.74 KiB) Viewed 2261 times
both buttons have Applicability conditions on them - and its based on a User Right/Access Level, so when a button is missing, the entire column is blank.
sometimes, both columns are blank.

would be nice if in a Render script, I could totally hide those columns. or change the columns to 1px width.

does anyone else get feedback from users about these empty columns?
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 1828
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Hiding entire columns in Query (grid)

Post by Jaymer »

Solution:

Code: Select all

var a = new AwareApp_SystemValueAction (
	"AccessLevel",
	null,
	function (value) {
		console.log(value);
		if (value == "OEM" || value == "OEMAdmin" || value == "Cust")   {
			// widget.hideColumn("ColView");   *NOTE, this doesn't work.  left here for example
			widget.hideColumn(widget.columns[1]);
			widget.hideColumn(widget.columns[0]);
		}
	},
this,
false);

a.run ();
Based on an old JT post: https://www.awareim.com/forum/viewtopic ... umn#p36627
And Support's help here: https://www.awareim.com/forum/viewtopic ... 255#p51887

--> JaymerTip
Last edited by Jaymer on Sat Nov 02, 2019 10:50 pm, edited 1 time in total.
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 1828
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Hiding entire columns in Query (grid)

Post by Jaymer »

In the code above, you can see this line:
widget.hideColumn("ColView");

Well, if you had a real column named "Name", or "Address" in your grid, then this format of hideColumn works.
Problem is that "Operations with Rows" columns do not get names [that I can see], so I had to hardcode in "hide column 1 & 0".
I tried putting an ID in the button (ie. ColView for ColumnView, and had ColDetails for the Details button) but none of that worked.
Luckily the Kendo docs also had a way to hide them specifically by Col #.

And I still have Aware's applicability condition active, so even if someone was to poke around and show the columns, all they'd get are 2 empty columns, so I don't really see a downside to using this.
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply