-
21 May 2012 6:56 AM #1
Sencha Architect 2 problem with config onItemDisclosure
Sencha Architect 2 problem with config onItemDisclosure
Hello everyone!
I have a problem with Ext.dataview.List. His config. onItemDisclosure in sencha architect 2 has only one boolean parameter.
In the guide has it:
And question:onItemDisclosure : Boolean/Function/Object3True to display a disclosure icon on each list item. The list will still fire the disclose event, and the event can be stopped before itemtap. By setting this config to a function, the function passed will be called when the disclosure is tapped. Finally you can specify an object with a 'scope' and 'handler' property defined. This will also be bound to the tap event listener and is useful when you want to change the scope of the handler.
How correctly give the method a function, not the bool variable?
It is only for sancha architect 2.
Thanks.
-
22 May 2012 12:10 AM #2
image for my question
image for my question
I added a screen to my question
-
22 May 2012 9:08 AM #3
You need a controller with a controller action.
Drag a controller action to your controller and add the component query, event name ("disclosure") and a function.
This will add something like the following in your generated controller code:
Code:config: { control: { 'list-ref': { disclose: 'function_name' } } } function_name: function () { do_something_here(); }
-
22 May 2012 9:58 AM #4
Currently, you cannot configure onItemDisclosure to a function. We're aware of the limitation in Architect when certain configurations take mixed types and we don't provide all of them. In particular we don't have anything that can accept a boolean/number/string AND also accept a function.
In the interim, you should set onItemDisclosure to true and subscribe to the disclose event.
worthlutz's response of using a controller action is also a valid way to do this.Aaron Conran
@aconran
Sencha Architect Development Team
-
23 May 2012 12:18 AM #5
It worked
It worked
Thank for you! I done this. All worked.

-
23 May 2012 12:29 AM #6
-
23 May 2012 1:14 AM #7
About sencha architect
About sencha architect
I found the answer!
It's easy.It should be onthe panelcodeclick"Overrides class"and add theconfig.It looks like this:
Ext.define('tsvb2.controller.override.playerEdit', {
requires: 'tsvb2.controller.playerEdit'
}, function() {
Ext.override(tsvb2.controller.playerEdit, {
config: {
control : {
'#players_list' : {
disclose : 'onDiscloseEvent'
}
}
}
});
});

-
23 May 2012 6:14 AM #8
No! You do not need to "override". You missed the part of my answer.
This means adding a "controller action" from the "Behaviors" group(on the left) in the Architect toolbox to your controller in the Project Inspector(on the right).Drag a controller action to your controller and add the component query, event name ("disclosure") and a function.
Then select the "controller action" in the Project Inspector and change the "config" items(below the project inspector) for that action: targetType, name, controlQuery and fn. I find it easier to do it in that order.
This will add the proper code to your controller all you have to do is add the body of the function named in fn.
Worth
-
23 May 2012 10:27 PM #9
Thank you for the explanation. I'm very grateful

-
11 Oct 2012 7:23 AM #10
Hi
Actuallly in SA 2.1.0 b640 setting onItemDisclosure with a function doesn't have paramater so how can retrieve data values from item disclosure?


Reply With Quote