PDA

View Full Version : undocumented shorthand?



brycekmartin
25 Feb 2010, 7:08 AM
I'm trying to learn how to create a hybrid summary and I'm looking at this example... http://www.extjs.com/deploy/dev/examples/grid/totals-hybrid.html

In the xg.GridPanel delcaration there is an option ds which looks like it would be short hand for 'data store'. The problem is that I can't find this documented anywhere in the API documentation under the GridPanel or any of its parent classes. Is 'ds' documented anywhere, anybody know its long hand equivalent?

thanks
ExtJS novice.
Bryce

rbastic
25 Feb 2010, 8:33 AM
From the source code:


// check and correct shorthanded configs
if(this.ds){
this.store = this.ds;
delete this.ds;
}
if(this.cm){
this.colModel = this.cm;
delete this.cm;
}
if(this.sm){
this.selModel = this.sm;
delete this.sm;
}


so as you can see, if you set .ds, it will move it to .store and delete the original.

Not sure why it's undocumented, but easy enough to see in the code.

brycekmartin
25 Feb 2010, 8:36 AM
Which source member did you see that in? My guess would be it was in ext-all.js? The version was minfied and I didn't look in the uncompressed version yet... thanks for the answer.

rbastic
25 Feb 2010, 8:52 AM
ext-all-debug.js

I use this file EXCLUSIVELY when developing/testing new code. Combined with Firebug, it is very easy to trace into the code and see what's happening.

All I had to do was search for 'GridPanel' and then '.ds' in my code editor

brycekmartin
25 Feb 2010, 8:55 AM
Unfortunately the example I linked to didn't use that file, and I hadn't gotten my example workable yet so I probably wouldn't have stumbled upon it searching the code. I filed a documentation bug in the forum for this undocumented short hand. Hopefully they will add it soon.

jay@moduscreate.com
25 Feb 2010, 10:08 AM
ds, sm, cm are all legacy shortcuts.

brycekmartin
25 Feb 2010, 10:10 AM
Are they deprecated and no longer suggested to be used?

jay@moduscreate.com
25 Feb 2010, 10:10 AM
I can't answer that. :-\

rbastic
25 Feb 2010, 10:36 AM
Why does it matter ! :p

Just use .store .... It's not going anywhere.

mschwartz
25 Feb 2010, 2:29 PM
ds, sm, cm are all legacy shortcuts.

Legacy like IE6, right?