Page 1 of 1

Grid element visibility within dynamic lists

Posted: Mon May 27, 2013 4:36 am
by Nick Wilsher

Hi
I want to set visibility on & off for grid elements that are contained within dynamically populated list items. Visibility is to be controlled via button click events and applies to all items in the list. ie buttons control what data is shown in the list.

To do this I am setting the grid elements visibility parameter from the button click event. This works fine for a static list but not for a dynamic list

For a dynamic list I have tried adding a second event action that invokes the data service again to reload the list. This works for the first instance of the button event but none subsequently.

Any guidance appreciated

Thanks


Grid element visibility within dynamic lists

Posted: Mon May 27, 2013 10:38 am
by Kateryna Grynko

Hi Nick,

You can use JavaScript to hide Grid.

For example, you have a Grid component named "dataGrid" in the List: Image

The following code will be executed on Hide button click:
codevar listItem = $(this).closest("li");
listItem.find("[name=dataGrid]").hide(); /code


Grid element visibility within dynamic lists

Posted: Tue May 28, 2013 11:15 pm
by Nick Wilsher

Thanks Katya

My case was a little simpler. The button is external to the list and controls the grid visibility for all items in the list uniformly not on an individual row basis.

Your answer pointed me in the right direction though (ie learn JS & JQuery ! ). I have done it by setting a class to each grid element and using
$(".class").hide(). There are probably other / better ways but it will do for the moment.

Thanks again

Nick