Reload jqGrid
0Today I was looking for the method to reload the JSON data of jqGrid.
With firebug I selected some element the grid was in with:
I chose .ui-jqgrid because that was one of the classes of the grid container. But this doesn’t work! The grid table tag is the element that has the actual grid ID. In order to get the generic code above work, we have to add the table element.
And now it works as expected!
Doctrine 2 – Use foreign key as field in DQL
0In doctrine 2 there are by default no foreign key fields a ID. For example your “product” entity might have a “shop” property, but no “shopId” property.
To get all the products that belong to a shop you would always have to make a join like this:
But in certain situations it would be nice to use the foreign key column directly, in this case “shopId”. That More >
Drupal 7 – Multi language front page
1It’s not possible in Drupal 7 to define a front page per language with the core or i18n module or something. However with a little bit of code it’s still not so hard to do.
Create a custom module “alter” for example. Create the folder in “sites/all/modules/alter”. Create “alter.info”
And create a file with the name “alter.module”. And put the following code in it with your More >
Cross browser border radius with CSS3 PIE
0PIE stands for “Progressive Internet Explorer”. With PIE you don’t have to wait any longer to use the CSS3 border-radius property. A lot of browser already support it out of the box, but Internet Explorer only since version 9.
To also have support in Internet Explorer 6, 7 and 8 use PIE! There are two options for using it. With a htc behaviour file or with JavaScript.
Read more about it on the official website: http://css3pie.com/
Doctrine 2 i18n translatable extension
0Doctrine 2 doesn’t have an i18n (internationalization) behaviour in the core anymore like Doctrine 1 had.
But luckily for us, Gediminas Morkevičius build the translatable behavior extension for Doctrine 2. Translatable behavior offers a very handy solution for translating specific record fields in diferent languages. Further more, it loads the translations automatically for a locale currently used, which can be set to a translatable listener on it’s initialization or later for other cases through the Entity itself.
Checkout the website: http://gediminasm.org/article/translatable-behavior-extension-for-doctrine-2
Set attribute on select option with Zend_Form
3Today I needed to disable a few options in a status select box when building a Zend Framework application. Luckily this is very easy to do, but you just have to know how.
Make sure you set all available options first:
Below that line you can set an attribute on some options. For example, if you want to disable the first, second, and fith option in the select box:
And you’re done!
Zend Framework – Add custom resource type to autoloader
1This week I wanted to created the folder “application/grids/” to store my grids in. For example the path to the grid is “application/grids/Product.php”. The code inside this PHP file:
You will now get the error “Fatal error: Class ‘Application_Grid_Product’ not found”. The new path must be added to the Zend Autoloader in order to load the required classes. Your bootstrap must look like this:


