PDA

View Full Version : [CLOSED] ConfigItem Listener



bayoglu
Mar 26, 2013, 4:01 PM
Hello!

Is it possible to configure listener for a configuration item's change event?

For example, below is a sample custom configuration for a grid panel. I want to perform a spesific task on filterID value change. Is it possible? If not, can you suggest an alternative way for such a requirement? May be using an ext:hidden object?

Thanks.


<CustomConfig>
<ext:ConfigItem Name="filterID" Mode="Raw" Value="0" Encode="false">
</ext:ConfigItem>
</CustomConfig>

Daniil
Mar 26, 2013, 4:06 PM
Hi @bayoglu,

You can define the setFilterId function for the GridPanel and change the filterID property only via this method.

Within the setFilterId function you can do required actions.

bayoglu
Mar 26, 2013, 4:21 PM
Hi Daniil!

How exactly can I define a function for grid? You mean defining function as a config item? Could you please post a sample markup?
Well, I need this functionality to filter grid store from listeners of other objects in the page as a non-blocking thread. I tried to make it clear below:
Grid1: which I am trying to set filterId configuration.
Grid2: on row select event, I want to filter Grid1's store.
What I need to do is, in Grid2's row select handler, I just want to set Grid1's filterId and finish its work. Grid2's store will be filtered in another thread. Is implementing your suggestion suitable for this requirement?

Note: The overall idea is, If you remember the long time taking event in row select listener causing un-intended "flying(;" of drag text we discussed here (http://forums.ext.net/showthread.php?23994-Grid-row-startDrag-on-time-consuming-select-handler): , I am trying to get this long time taking task out of row select handler.

Thanks.

Daniil
Mar 27, 2013, 4:29 AM
How exactly can I define a function for grid? You mean defining function as a config item? Could you please post a sample markup?


Yes, I meant a ConfigItem.

<CustomConfig>
<ext:ConfigItem
Name="setFilterId"
Value="function (filterId) { this.filterId = filterId; /* some staff */ }"
Mode="Raw" />
</CustomConfig>



Well, I need this functionality to filter grid store from listeners of other objects in the page as a non-blocking thread. I tried to make it clear below:
Grid1: which I am trying to set filterId configuration.
Grid2: on row select event, I want to filter Grid1's store.
What I need to do is, in Grid2's row select handler, I just want to set Grid1's filterId and finish its work. Grid2's store will be filtered in another thread. Is implementing your suggestion suitable for this requirement?


Well, there is no multithreading in JavaScript. Anyway, the actions will be executed on row select. I don't think there is no better way (if any) than setting up a Delay for a Select listener.



Note: The overall idea is, If you remember the long time taking event in row select listener causing un-intended "flying(;" of drag text we discussed here (http://forums.ext.net/showthread.php?23994-Grid-row-startDrag-on-time-consuming-select-handler): , I am trying to get this long time taking task out of row select handler.


There are some posts in the thread which you have not answered.