In Sencha ExtJS how not to Thrash Precious Memory with Popup Forms

Typically, in the callback of a button that opens a popup window, we just create the window, get access to it’s form and then show it.  The code looks something like this: var data = this.getSessionDetailPanel().data, store = this.getSessionsStore(), session = store.getById(data.id), formWindow = Ext.create('widget.sessionform'), form = formWindow.down('form').getForm(); // do stuff... formWindow.show(); Assuming the above code is in a Sencha ExtJS button handler that brings up the form, the problem is that when the form gets close, the form panel gets deleted (destroyed) and the next time you use it, it all has to be created again. A better solution is to add to the form … Continue Reading

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

image.png

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

A Minimalist WebAPI 2 Visual Studio Project

image.png

Introduction Many of us have been asking Microsoft to keep all the extra stuff out of Visual Studio 2013 projects.  For example, I don’t want JQuery in my project yet almost all project types include it.  So, here are my steps to create just WebAPI 2 and no other types that are not directly that. The Steps File / New / Project Empty Project with Just WebAPI Then, when I go into References / Manage NuGet I see just 4 packages My Solution explorer is small and if I look in my App_Start, I just have one simple file, WebApiConfig.cs which is as follows:   Project size, 29 files, 9 folders.   I’d say that’s pretty good. … Continue Reading

ExtJS form cancel, Save Changes If Changes Have Been Made

image.png

  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

Follow

Get every new post delivered to your Inbox

Join other followers: