How To Properly Dynamically Load a Store With Data in Sencha ExtJS

Introduction For Silicon Valley Code Camp, I’m busy rewriting the session submission and editor module so that we can very soon begin to accept new session submissions.  For those that had the pleasure of submitting sessions last year, you all know that I did not make your lives very easy.  As Douglas Crockford said to me, “I puzzled my way through it”.  Not a ringing endorsement. My Latest Learning The step I’m working on now is showing the session submitter what session tags are associated with the session they are working on.  I could do this by making a separate query (rest call) to a tags store, or, since I have already pulled in a full session record (from my session rest service) that has the tags in it, I’m … Continue Reading

ExtJS form cancel, Save Changes If Changes Have Been Made

  It seems like when a user cancels out of form after making changes, the obvious thing that should happen is: If Changes Have Been Made, Prompt User To Save If No Changes Have Been Made Just Exit Pretty simple, but we still have to do it. Without showing all the detail code, consider the code below which runs in the Sencha ExtJS MVC controller that gets executed when the user presses cancel on a running form like the following:   The JavaScript Code is as follows: onCancelbuttonsessionitemidClick: function(button, e, eOpts) { var form = button.up('form').getForm(), formWindow = button.up('window'), session = form.getRecord(), store = this.getSessionsStore(); … Continue Reading

Using the ExtJS SimManager To Provide Mock JSON Data To a Store Proxy

I’ve got an ExtJS Store defined as follows: Ext.create('Ext.data.Store', { storeId: 'testStore', fields: ['codeCampYearId', 'title'], autoLoad: true, pageSize: 9999, proxy: { type: 'rest', url: '/rest/SessionExt', reader: { type: 'json', root: 'data' } } });   I have some JSON data in a local file that I want to use and I don’t want to change the URL.  Using the ExtJS SimManager, I can make some simple code changes and my ExtJS ajax request … Continue Reading

Finding Date Formats in ExtJS 4

Who Moved The Cheese? For those looking to find the date formats associated with data models, here is a big hint for where to find them: http://ext.load.hu/ext-4.0-pr5/docs/api/Ext.util.Date.html And, if that moves again, below is a cut and paste of the date formats as of now. Format Description Example returned values ------ ----------------------------------------------------------------------- ----------------------- d Day of the month, 2 digits with leading zeros 01 to 31 D A short textual representation of the day of the week Mon to Sun j Day of the month without leading zeros … Continue Reading

Follow

Get every new post delivered to your Inbox

Join other followers: