jQWidgets Forums
jQuery UI Widgets › Forums › Grid › change editable dynamically
Tagged: angular grid, editable grid dynamically, grid, jquery grid
This topic contains 8 replies, has 2 voices, and was last updated by Programmerswe 9 years, 8 months ago.
-
Author
-
Hi!
So ive got a signed in user, which i can access with document.getElementById.
Depending on who this user is, i want to set the editable in to true or false.
Is there a simple way to do this?{text: ‘Comment’, datafield: ‘Comment’, width: 300, editable: true}
Cheers!
Hi Programmerswe,
You can use the Grid’s method – setcolumnproperty for setting column properties dynamically. For more information, please refer to jqxGrid’s API Documentation.
Best Wishes,
Peter StoevjQWidgets Team
http://www.jqwidgets.comIve tried yo use
gridComplete: function () { var loggedInUser = document.getElementById("loggedInUser").innerHTML; if(loggedInUser == "ME"){ $('#jqxgrid').jqxGrid('setcolumnproperty', 'Comment', 'editable', true); } },
But it didnt work for some reason, but gave me:
uncaught exception: jqxCore: invalid property ‘gridComplete’
Hi Programmerswe,
We do not have property called gridComplete in our API so such Error is expected. May be you’re looking another third-party product not from our website.
Best Wishes,
Peter StoevjQWidgets Team
http://www.jqwidgets.comIm looking for a way to run the
var loggedInUser = document.getElementById("loggedInUser").innerHTML; if(loggedInUser == "ME"){ $('#jqxgrid').jqxGrid('setcolumnproperty', 'Comment', 'editable', true); }
when the grid is loaded. So i can change the comments editable value depending on which user is logged in on the site.
Is there a way to do this with anything in your api?Hi Programmerswe,
You should use “setcolumnproperty” to dynamically change a property. This works so I suggest you to check your own code.
Best Wishes,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI am using the “setcolumnproperty”. The question is where i should use the if statement containing it.
Hi Programmerswe,
I do not know where you should use it in your code. This does not depend on us, but by your implementation’s logic.
Best Wishes,
Peter StoevjQWidgets Team
http://www.jqwidgets.comGot it, thanks for the help, you guys are awesome!
-
AuthorPosts
You must be logged in to reply to this topic.