[CLOSED] What are the differences between .DataSource and .LoadData()

  1. #1

    [CLOSED] What are the differences between .DataSource and .LoadData()

    Hi all

    Could someone give a brief explanation to me ? What are the differences between

    MyStore.dataSource = someKindOfArray;
    MyStore.dataBind();
    and

    MyStore.loadData(someKindOfArray);
    Both seem to work ?!

    Kind Regards
    Peter
    Last edited by Daniil; Oct 29, 2014 at 3:58 PM. Reason: [CLOSED]
  2. #2
    Hi Peter,

    A Store's LoadData method is a wrapper for the JavaScript loadData method.
    http://docs.sencha.com/extjs/4.2.1/#...ethod-loadData

    The key point is "Using this method is great if the data is in the correct format already".

    So, the data passed to a .LoadData() call goes directly to the Store bypassing a Store's Model.

    If you use a Store's DataSource then the data is serialized according to the Store's Model. Also all client side transformations like ModelField's Mapping and Convert are done.
  3. #3
    Thank's Daniil for this...

    Is it possible that the 'loadData' triggers the Prepare Command and the 'dataSource/dataBind' doesn't ?
    I had this while updating an exsting store...

    Peter
  4. #4
    I would say they both should trigger a PrepareCommand, because they both should trigger refreshing of GridPanel. In other words when a GridPanel refreshes, it triggers PrepareCommand handlers.
  5. #5
    Ok, thank you I understand now :-)

    Peter

Similar Threads

  1. [CLOSED] Migrating from v1.5 to 2.0.1 differences.
    By ViDom in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 27, 2012, 1:47 PM
  2. Replies: 5
    Last Post: Feb 01, 2012, 11:54 AM
  3. Replies: 3
    Last Post: Feb 24, 2011, 2:41 PM
  4. [CLOSED] Which are the differences between ColumnTree & TreeGrid?
    By capecod in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 17, 2011, 2:19 PM
  5. Differences?
    By state in forum 1.x Help
    Replies: 1
    Last Post: Mar 21, 2009, 8:53 AM

Posting Permissions