Results 1 to 5 of 5

Thread: DataModel and DataStore equivalencies

  1. #1
    Ext User
    Join Date
    Mar 2007

    Default DataModel and DataStore equivalencies

    Hello, very new to EXT here.

    I was setting up some test last week to run yui-ext around the block. With Grid for example, I was able to grab the id (xmlDataModel) which I made meaningful:

    grid.on('rowclick', function(grid, rowIndex) {

    So, then I hear about EXT and 1.0. I have converted my testing rig to 1.0 but am at a loss when it comes to understanding DataStore (DataSource?)

    I'm thinking in the neighborhood of:


    Obviosuly, no joy :-)

    How would I achieve the equivalent of the above in 1.0 Alpha 2? Or, more generally, how would I access the data in any of the xml fields?

    Also, I was able to load a new xml data set into the grid at will, by doing (anywhere on the page):


    How does one achieve this?

    Am I even close: ?


    Lastly, anyone up for consulting? I've never had this much trouble finding paid help before in my life! Good Grief Charlie Brown....



  2. #2
    Sencha User mystix's Avatar
    Join Date
    Mar 2007


    maybe this will help:
    var ds = grid.getDataSource(); // DataStore
    var cm = grid.getColumnModel(); // ColumnModel
    var r = ds.getAt(5); // 6-th Record from the DataStore
    var colName = cm.getDataIndex(7); // name of the 8-th column from the Record
    r.get(colName); // the record you want

  3. #3
    Ext User
    Join Date
    Mar 2007


    Thanks, that worked like a charm.

    Correct me if I am wrong, there is no DataStore documentation. I am not complaining, just making sure I am not missing some source of docs for this.

    To get at a selected rows data:

    var s = sm.getSelected();
    var c = cm.getDataIndex(1);

  4. #4
    Sencha User mystix's Avatar
    Join Date
    Mar 2007


    yep. right now jack's not working on documentation much. more on bugs and features.
    until then, we'll just have to dig into the source and rely on this forum for help.

    another place to hunt would be the examples folder in the file.
    there are already some great grid examples in there.

    haven't really fiddled with the RowSelectionModel / CellSelectionModel, but from your example you should probably be looking at the CellSelectionModel.

  5. #5


    Hi, I have a problem here maybe someone could help :d

    I've used @mystix code, I have a PropertyGrid(new for PropsGrid) and after I edited a cell I want to save it in database.

    The event function looks like this:

    function afterEdit(propsG) {

    var dso = propsG.getDataSource();
    var cmo = propsG.getColumnModel();

    var name = dso.getAt(0).get(cmo.getDataIndex(1));
    var d1 = dso.getAt(1).get(cmo.getDataIndex(1));
    var d2 = dso.getAt(2).get(cmo.getDataIndex(1));
    var d3 = dso.getAt(3).get(cmo.getDataIndex(1));
    var d4 = dso.getAt(4).get(cmo.getDataIndex(1));
    var d4 = dso.getAt(5).get(cmo.getDataIndex(1));

    // update new data
    update( name, d1, d2, d3, d4, d5 );

    The problem is: if I modify the "name" -
    var name = dso.getAt(0).get(cmo.getDataIndex(1)); take the old value of name not the new value.


Similar Threads

  1. a2: Datastore: remotesort fails if name is not equal mapping
    By Wolfgang in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 12 Mar 2007, 12:45 PM
  2. dataStore loadData and XML
    By ericd in forum Ext 1.x: Help & Discussion
    Replies: 36
    Last Post: 5 Mar 2007, 4:03 PM
  3. DataModel.query bug in FF
    By jdgrieco in forum Ext 1.x: Bugs
    Replies: 1
    Last Post: 29 Oct 2006, 5:02 PM
  4. this.dataModel has no properties
    By danvega in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 20 Oct 2006, 4:02 PM
  5. Reusing the DataModel
    By dmayer in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 12 Oct 2006, 9:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts