Results 1 to 4 of 4

Thread: Using Data In Sencha Mobile vs Ext JS

  1. #1
    Ext JS Premium Member
    Join Date
    Jan 2010
    Posts
    3

    Default Using Data In Sencha Mobile vs Ext JS

    I've done a significant amount of working in Ext JS and have been very excited about the possibilities with Sencha Mobile. After some proof of concept with porting portions of our UI to be used in a mobile environment with Sencha Mobile, I found that a considerable amount of what I've been doing with UI moves right over. Obviously, there are some areas where a mobile-specific version must be created. Now that we have discovered how we can utilize the UI, I turned my sights to wiring up the UI to our data sources. This has not been as painless.

    It seems that in Sencha Mobile I cannot just load a JsonStore (or other data.Store) with my data by setting a 'fields' object, but I must instead use the concept of Ext.data.Model. The documentation for JsonReader states the by defining a set of fields, Sencha Mobile will create an Ext.data.Model under the hood. From what I'm seeing, this just isn't happening. The fields object I supplied (and that has worked under Ext JS) appears to be ignored and a new Ext.data.Model is created with every field in my data being mapped, including the fields above the 'root' I designated in my store. Additionally, I only load 2 fields into the store under Ext JS and have been converting one of those fields during the load whereas now it is loading everything I receive from the server.

    Bottom line, while I expected to rewrite the UI for mobile, I did not expect to have to rewrite my data load methods and stores. It would seem that if I'm using Ext JS and Sencha Mobile, I could have a fair amount of code reuse. Is Ext.data.Model the way of the future for Ext JS? At least then I could plan to later use one code base rather than maintaining separate code for mobile and non-mobile. There's also some little differences such as a JsonStore firing 'load' after loading data whereas a JsonStore in Sencha Mobile fires 'datachanged'. Again, frustrating to rewrite code due to the one minor change (yes, I can obviously write my own event 'load' and listen to 'datachanged', then fire 'load' so I can reuse my old code, but it's a workaround where it would seem it should 'just work' between two complementary products from one company).

    Or perhaps I'm doing something very wrong, I'd love to hear a data solution that works for both Ext JS and Sencha Mobile.

    -Ian

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    We realise that people will want to use the same business logic and data for both desktop and mobile apps, so the Ext 4 data package will mirror the one that is used in Touch, in fact it's exactly the same code base so far.

    Up until that point, you'll need to keep going along as you are, but we're working to consolidate the API so it will be seamless in future versions.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Ext JS Premium Member
    Join Date
    Jan 2010
    Posts
    3

    Default

    Quote Originally Posted by evant View Post
    We realise that people will want to use the same business logic and data for both desktop and mobile apps, so the Ext 4 data package will mirror the one that is used in Touch, in fact it's exactly the same code base so far.

    Up until that point, you'll need to keep going along as you are, but we're working to consolidate the API so it will be seamless in future versions.
    Thanks for the prompt reply. This is what I need to hear at this point. I expect some changes moving to Ext 4, but as long as Ext/Sencha is moving toward a common codebase, I can deal with differences for now (and learn about what's coming next). It would be nice to see a public beta (or private for subscribers) of Ext JS 4 for now, but I'm guessing we'll see it right after the conference November.

    Code reuse across the mobile and desktop platforms will be essential to our business and will be a driving factor behind our continued use of Ext/Sencha.

    -Ian

  4. #4
    Ext JS Premium Member
    Join Date
    Jul 2008
    Posts
    52

    Question Data package completely different to Extjs

    Hi, thanks for the clarification. I was also wondering the last days.
    It seems the old "Store" Model with loading column information is not supported anymore?

    Currently we have an Extjs Application which uses the onMetaChange event to init the column model itself from a server response. Our column model is defined over the ORM on business logic site.
    I dont see how this can be achieved in sencha touch/extjs 4.0.
    Maybe we have to preload "all" column models to the ModelMgr first?!
    Can anyone give me a hint on this?

    Thanks in advance.

    Robert

Similar Threads

  1. sencha touch and opera mobile for windows
    By reminder in forum Sencha Touch 1.x: Discussion
    Replies: 7
    Last Post: 27 Oct 2011, 5:09 AM
  2. Ext-js to Sencha
    By raiworld81 in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 2 Aug 2010, 5:40 AM
  3. Future of Sencha mobile, Ext core and non webkits.
    By george.antoniadis in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 19 Jul 2010, 9:45 PM
  4. Ext JS 4.0 RoadMap and 'Mobile' apps?
    By Bucs in forum Community Discussion
    Replies: 4
    Last Post: 22 Sep 2009, 7:28 AM
  5. URGENT: Ext 1.1 Grids Not Rendering In Opera 8.60 For Windows Mobile
    By OneManArmy in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 18 Oct 2007, 1:39 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
  •