Posts Tagged ‘javascript’

ContentPane in dojo not loading scripts? This is how you fix it.

December 16th, 2010

I was planning on writing my first enquiry on how to do something in dojo, but just before I pressed the submit button, I thought I’d look into one more thing and as the saying goes – “it’s always in the last place you look” (probably because you stop looking after you find whatever it is you’re looking for).

So the problem I had was that I wanted to load a datagrid inside a contentPane in a pet project my newbie friends and I are using to sharpen our Zend Framework skillz.

I’ve been idle (and will continue to be for the rest of the year) so all my tickets are pretty much at a stand still. This included a ticket which reports that a remote datagrid does not load properly in chromium / google chrome, but loads fine in Firefox. But seeing as I have a few hours to kill from being idle (development wise, but actively looking after family) , I thought I’d do an idle search into why this was happening. Dojo could not possibly have a bug, there must be some magic attribute that needed to be set which would make it all better.

So I started my search. Looking for things like “ContentPane not loading datagrid in tabContainer dojo” through to “javascript events not firing in contentPane dojo dijit” for those of you who look for answers to advanced questions when it comes to the dojo toolkit, you know how teeth-gnashingly frustratting it is to look for answers.

A couple of them mentioned “executeScript” attribute, but that was from ages ago, so I tried it a couple of times to no avail in dojo 1.5 then gave up looking for answers that use executeScript attribute.

» Read more: ContentPane in dojo not loading scripts? This is how you fix it.

Dojo’s IndirectSelection plugin for the Enhanced Datagrid is deceptively unuseful.

November 23rd, 2010

One of the requirements for a project I’m working on is the ability to send emails to selected rows in the datagid. I thought no problem, the IndirectSelection plugin of the EnhancedGrid should be able to handle that semantically! Reading the API and when I initially tried it out I saw the neat little checkboxes as the first column. “Phoar! Checkboxes!” I swear those CBs had a glow around it and I could hear a choir singing in the background (“haaaaaaaaaaaaaa, easy fix for a requiremeeeeeeeeeeennnnnnnnnnnnnnt”).

Then I tried submitting with a bunch of rows selected. It was then clear to me that IndirectSelection is just that. It gives you checkboxes or radiobuttons to tell you that it’s selected, but aside from notification, it has no other use. The value in it is not configurable and neither is the name… Sad. Guess I’ll just have to insert a field for a checkbox. I’ll leave this till later. This functionality is a “nice to have” rather than critical functionality anyway.

» Read more: Dojo’s IndirectSelection plugin for the Enhanced Datagrid is deceptively unuseful.

Two Dojo JavaScript Gotchas that got me

November 19th, 2010

I was just about ready to tear my own head off when I’ve finished unit testing my Service and Model classes and had damn near close to 100% code coverage, and ran into some really fiddly issues with dojo. I’m doing this retrospectively, so off the top of my head these are the two issues that had me scratching my head due to their obscurity.

First issue: got a ”dojo.data.ItemFileWriteStore” is not a constructor” message.

I use ItemFileWriteStore as my data store for a combo box intended to list fields in a search. Users could then have the ability to filter through the list by typing a letter in the combobox and auto complete suggestions will be displayed in a list below ala a select list. Problem is when I was running it, I get this error message.

I decided to verify that nothing’s wrong with the way I built the dojo JS library. Then headed to google. First few results were garbage, then came an exact match. It was one of two cases:

  1. dojo.require() is missing
  2. The constructor statement occurs before dojo has completed loading.

» Read more: Two Dojo JavaScript Gotchas that got me

Remembering Field/Column widths in DojoX Datagrid Component

July 11th, 2009

We had to do implement a workaround for a limitation in the Dojox DataGrid component that does not have an easy way of remembering datagrid column widths adjusted by the user.

This took some time to actually get my head around, but I have managed to “will” this solution into existance. I say “will” because i’m not too happy with the implementation. It’s a workaround that works for the mean time anyway.

I’ve written the description here on the “DevProducts on Blogger” blog – Check out the post for more info: Persistent Column Widths in Dojo (dojox) DataGrids

My Web Development Firefox Extensions

November 27th, 2007

This is just a quick, minimal list of what firefox extensions I install for use in my day to day Web Development work. While some of the extensions may not be related to Web Development, they could be seen as essential convenience extensions.

Here’s the top ten in the order of how I install them (I’m not going to do a countdown as it’s so very “the late show with David Letterman”) on a brand new installation of Firefox on Ubuntu, Windows, Fedora or any other operating System that supports Firefox.
» Read more: My Web Development Firefox Extensions