While working with the simple table model, it occurred to me how bizarre the
getter methods on the model are:

Why, when "getDataAsMapArray" always returns an array of maps and "getData"
always returns an array of arrays, does "getRowData" return either a map or
an array contingent on whether the "rememberMaps" argument is true when you
set table data? "getRowData" should ALWAYS return an array, just like
getData does, so I don't have to either remember my "rememberMaps" setting
or do some type checking. Weird.

Why "getDataAsMapArray" instead of "getDataAsMap"? I understand that it
returns an array of maps, but if that reasoning is valid, then shouldn't
"getData" be called "getDataArrayArray"? If it were changed, it would align
so much easier to their row-level counterparts; it would merely mean the
inclusion of the word "Row" for the row-level methods. Weird.

Why, after setting "rememberMaps" to true, can't I just set an argument to
any of the get methods to NOT return the metadata? One case I'm playing with
now is having row data editable through a form inside a dialog. It's so nice
to just call "this._dialog.getController().getModel().set(myTableDataObj);"
rather than having to strip out the metadata keys which don't correspond to
form fields. It might just be that my use case and how I'm handling the
translation of table rows to form model is kind of silly, I don't know.
Still, it would be nice to exclude metadata selectively.

Obviously all this griping is easy to fix by some really simple code
additions to a model subclass, but I think the first two would probably be
good amendments to the framework proper.
-- 
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Why-are-the-simple-table-model-s-row-data-getters-so-unnecessarily-weird-tp6061894p6061894.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to