A quick digression about the constructor property in Javascript

When i think about the constructor, i think about the function called when a class is instantiated. Well, that is true about Java but i would like to write about the constructor in Javascript.

For me is a challenge write about the constructor; after years of Javascript i still see it as something confusing; anyway recently i had the opportunity to go through it and i would like to write here some considerations.

Continue reading

Advertisements
Posted in Javascript, Programming | Tagged , , , | Leave a comment

jPaginator as paginator for the jQuery Datatable plugin

Recently, at work,  i had to include the jPaginator as default paginator for the jQuery Datatable .

The way to add a custom paginator to the Datatable is really clean: you can write your own paginator as stand alone module and integrate it with the grid, as plugin, by extending the object $.fn.dataTableExt.oPagination (documentation here).

My goal was to get two paginators on the screen, one on the top (as jPaginator) and one on the bottom (the default one) of the grid. The jPaginator on the top is an interesting solution: if the user wants to jump over many pages, the jPaginator will perfectly fit that. When the user goes to the end of the page, the searched item is probably supposed to be on the same page or in a close one.

The full screen demo here: http://jsfiddle.net/lzzluca/duREA/embedded/result/

The code behind the demo: http://jsfiddle.net/lzzluca/duREA/

Sources: https://github.com/lzzluca/jPaginator4Datatable_bis

Foot note

Looking for an already written plugin, i have found this one: jPaginator plugin for Datatable . It works good but it didn’t match my goal, because it is designed to show the jPaginator only.

Some links

Thanks for reading

Posted in Javascript, jQuery, My code, Programming | Tagged , , , , , | Leave a comment

Fix the eee 1001px microphone issue for Ubuntu

Some months ago i have installed Ubuntu 12.04 on my eee 1001px; all was right but the microphone didn’t work. Checking on the web, it seemed to be an annoying problem for many people.

Continue reading

Posted in GNU/Linux, Tips | Tagged , , , , | Leave a comment

Multi select avoiding ctrl button, provided by pure select tag and jQuery

How many times we need to choose more than one item from a select tag? By default, it is possible to do that pressing the <ctrl> button. Holding down the ctrl button to select more values is considered not intuitive from many sources, so my goal was to allow multi selection avoiding the ctrl button. The usual approach consists in using an ul tag instead of the pure select one but it is not the approach described here; instead, i tried to develop, on the standard select’s selection, a new one that has the desired behaviour. Continue reading

Posted in Javascript, jQuery, My code, Programming | Tagged , , , , , , , , , , , , | 5 Comments