A couple of days ago David Walsh posted a blog entry where he recommended a video from Google about JavaScript. I’ve found this very interesting and I have done some research about how to implement this very easy to Mootools. There are a lot of do’s and dont’s  but what is the best practice for us as a Mootools developer? How to avoid the basic Mootools solutions and speed up your plugins? Well, I’ll post my neat workarounds to get your speed up.

I’ll start with modifying the DOM by injecting elements with the Mootools function inject(). Injecting elements to the DOM is very common with Mootools but it will make it slow down. To speed up you’ll have to do as little DOM modification as possible.

For example you load a JSON file and add elements depending on the content of the request. In this example we don’t avoid the Mootools each() function. We focus on the point that we don’t call the inject() function every time. This is my solution. Continue Reading »

The last week I’ve completed the development of the cvLinkSelect class. I’ve added the option to disable the select elements that are not active because the previous values are not set. This is great feedback for the user!

Check the updated page for the cvLinkSelect class!

I’m searching for a easy way to style the select elements to a custum layout just like the Select Box Factory or something like that. Also I’m going to figure out if this class is usefull with a multiple select box. Anyway, I’m finished with this for the moment!

I’m very happy that a lot of developers have found my cvLinkSelect class and found it useful. cvLinkSelect is a simple Mootools 1.2 class that links form select elements based on the previous value via JSON requests. The php part was very basic though and a visitor pointed me to write the php part better, shorter and more functional. And here we are, just a simple 10 line php function.

In most cases you’ll get the data from a SQL database or something like that and in therefore it’s an array.

/* $arr = array from the database */
$arr = array(//array(id,name),
			 	array(15,'15 inch'),
				array(17,'17 inch'),
				array(19,'19 inch')
			);

Continue Reading »

Top of Page