Showing The Record Count in a Sencha ExtJS Grid Made Simple

I use Sencha’s ExtJS for lot’s of data maintenance type applications.  One such application is an email response manager where it’s convenient to know how many different URL’s got clicked.  Basically, how many rows in the gridview.  Certainly, counting is an option but showing it in the title makes a lot more sense.

The tip here is that often you have to call store.load() on the store associated with a grid so with just a couple extra lines you can put the count in the title of that grid.  Those extra lines are basically just a callback to the store.load that then grabs a reference to the gridview.  In my case, I have a button on my toolbar (just above the gridview), and in the button’s handler I execute the store.load which passes the parameters to the store as well as sets the title on completion.

Here is the very simple code.


image

HTH’s

Add a Data Driven Combobox to ExtJS Form

I’ve been enhancing the session editor for AngularU  (Written in ExtJS 4.2)  and I’ve recently had to add a couple data driven comboboxes.  One to specify which track the session is in and one to assign which track the session is in.  Having done it a couple times in a row, my muscle memory is pretty good so I thought I’d do it again but this time on my blog.

This is what the result looks like:

image

The basics of the relationship between the table data is that we have a Session Table and a Track Table as follows:

image

For the sake of the controls, we actually have two rest feeds.  One Track and one Session.  You can see them both here:

http://angularu.com/rest/track

http://angularu.com/rest/session

The track is a primary keyof Id and a track name of Name.  Session has SessionTrackId as the foreign key.

So, the steps are as follows.  First we add a new model and store for the track table (we had the session model and store already).  Then we update the form that has that data with the combobox.  Below are the details of those thre places.

That’s it! Hope this helps

ReSharper Continues to Make My Life Easier as a Programmer

Again, it happened.  I was about go searching the web for the string format parameters to figure out how to format just the day of the week.  I type some code like this:

And up pops up the below screen from JetBrains Resharper giving my choices for ToString(). Very nice! Just sayin…

image

Publishing Just Your JavaScript Folder With Visual Studio

Who would have guessed.  With Visual Studio you can right click on any folder in your web project and say publish.  You can see me doing that right here below.

image

For years, I’ve struggled with how to just get certain files to an IIS web site.  The things that I have used (that all have issues) are:

  • Robocopy (only works if you can have a vpn network drive)
  • rsync (causes permissions problems and various other nasties)
  • ftp (has trouble syncing and the root folder is never where you want it

Now, I can skip all that assuming I’m using visual studio (which I usually am).

I get the nice success window quickly as follows

image

And that is all there is to it.

Plugin by Social Author Bio

Follow

Get every new post delivered to your Inbox

Join other followers: