-
16 May 2012 2:11 AM #11
You might need to manually bubble events from the child model / association store, though I would expect that is happening by default.
-
21 May 2012 6:58 AM #12
I'm attempting a very similar type data item. I basically wish to use a standard component that has various setters that the data controls. Following the examples early in this post I'm able to get a component to list in each data item, but I'm not sure how to set the values of the component.
Here's what I have for the component:
It's currently giving me a warning:Code:Ext.define("Stat.view.SplashListComponent", { extend : "Ext.Container", xtype : "splaem", config : { name : "temp name", items : [ { xtype : "component", id : "name", html : "temp" } ] }, setName : function(name) { var thisItem = Ext.ComponentQuery.query('splaem'); thisItem[0].down("#name").setHtml(name); } });
Code:[WARN][Ext.Component#constructor] Registering a component with a id (`name`) which has already been used. Please ensure the existing component has been destroyed (`Ext.Component#destroy()`.
And I'm not sure how to actually change the value of the name component. The query in the setName is somewhat useful, but it's only able to access the first one (I guess I could do thisItem.length but that seems like a hack).
Is there a better way to do this?
-
21 May 2012 9:54 AM #13
It s not the name of the component, it's the id that raise that error. Ids should be unique per dom so don't use them like that. Using an id for an item renderer will make you find many elements with the same id.
-
21 May 2012 11:45 AM #14
I understand that the id can't be reused per normal html standards, but isn't that id used to set the data? Here's a bit of code from the dataitem that uses this splaem:
Code:dataMap : { getSplaem : { setIcon : 'image', setName : 'name', setGeneralInfo : 'AndroidTotalDownloads' } }, splaem : { xtype : "splaem" }Last edited by Kikketer; 21 May 2012 at 11:45 AM. Reason: Some strange editing done with the word "Splaem"
-
21 May 2012 1:32 PM #15
In your example, yes the id is used to find that element, but it shouldn't. Use a different selector, like any config attribute, to reference your desired element.
Id should be unique to keep its sense of identifier.
-
22 May 2012 5:13 AM #16
-
22 May 2012 5:21 AM #17
-
25 May 2012 3:35 AM #18
Dynamic HTML
Dynamic HTML
This might come out of context, but I'm trying to make a component list of my own and I need to make every list item comprise a string (html) and 2 (hidden) buttons at the far right. I have adapted the kitten example. but I'm only able to put in 1 field from my model in the name component.
Is it possible to use a template like in the 'regular' type list?
something like
or do I need a component for each field in the model?HTML Code:itemTpl: {field1} {field2} {field3}
-
25 May 2012 4:26 AM #19
-
25 May 2012 4:31 AM #20
okay, in my model I have 4-5 fields that I'd like to show in my list. With the 'non-component' list I would make a template stating all the given fields I want to show on each list item:
each set of curly brackets as a placeholder for each of the field I want to show in a list item.PHP Code:'{field1} {field2} {etc...}'
How is that accomplish in the component list?
Do I need a component for each field or is there a way to make a template like before?


Reply With Quote
