jueves, 8 de noviembre de 2012

Working With JQueryDataTable data

I´m using JQuery-DataTable in a SharePoint 2010 Application. 
I comunicate server to client throught $.getJSON(url, parameter, function(returnData){});
But when I pass the JSON to JQueryDatatable, it doesn´t work, why? I don´t Know.
It works, with arrays, not with objects, I don´t why. 
But we must convert the JSON Object into Array. So We have to use this simple function

function ConvertObjectToArray(obj) {
        var arr = [];

        for (cont = 0; cont < obj.length; cont++) {
            var t = 0;
            arr[cont] = [obj.length];

            for (var propiedad in obj[cont]) {
                arr[cont][t] = obj[cont][propiedad];
                t++;
            }
        }

        return arr;
    }

viernes, 26 de octubre de 2012

Javascript Koans

I've started studing javascript, because in my project one work-mate is using jquery-dataTable + JSON.

So I thought, I must learn this language. One way is throught koans.
I down the needed files from account github. Later I des-compressed the .zip file and opened 'about_asserts.js' in the 'topic' folder.




On the other hand I opened 'jskoans.htm' with the browser, and I started.



It's very simple & very useful.
Happy learning!!!!

Dustin O'Halloran

So nice song video
This author has some interesting piano stuff.

Resources for Javascript

crockford.com
node.js jquery
lesscss
coffeescript
async comunications
A spanish javascript course
Some Stuff
Learning JavaScript Design Patterns A book by Addy Osmani