Affichage des articles dont le libellé est Pass model config from store?. Afficher tous les articles
Affichage des articles dont le libellé est Pass model config from store?. Afficher tous les articles

lundi 2 février 2015

Pass model config from store?

I have a TreeStore and a TreeModel and want the TreeModel to allow checks in certain situations. Simple solution would be to have 2 different models but I'm trying to figure out how to use one. So far I haven't been able to do that. I want to be able to set the checked default to either false or null from store config. Any ideas?

Code:



extend: 'Ext.data.TreeModel',


fields: [
{name: 'leaf', type: 'bool', calculate: function(data) {
return !data.root && !data.children;
}},
{name: 'checked', type: 'bool', default: false} // Want false or null here
]





Pass model config from store?