Posts Tagged ‘ajax’

flexigrid – web 2.0 jquery grid

April 21st, 2009

flexigrid
maneiro este grid usando jquery ! http://flexigrid.info/

popular um combo com jquery

November 10th, 2008

Bem simpático o tutorial de como encher um combo com o jquery.
a idéia é basicamente fazer uma chamada POST a um site com os dados, e colocar estes dados como conteúdo html do combo criado anteriormente.

acho que seria legal se os dados retornados fossem no formato JSON, assim a montagem do html, ou seja criar os options, seria responsabilidade da interface não do server. segue o link do tutorial do rafael cunha.

http://www.rafaelcunha.com/2007/05/10/populando-combobox-com-jquery-ajax/

jquery – table in table

September 2nd, 2008

Playing with Jquery, I need to add and table inside another existing table, and after some fight with the code, I realized that the “trick” would be add the content of the remote table, inside a TD.

So here are the steps :

1. make the TD hidden, because we don’t want an empty TD taking space in the table. use style=”display: none;” in the TD definition.

2. create an external file that will be inserted in the TD, I called it mytable.html.

3. identify the TD so we can manipulate it by it’s ID, for example something like : id=”data_item”

4. add the links to insert the data in the TD

<a href=”javascript:addData();”>show</a>
<a href=”javascript:hideData();”>hide</a>

errrr, why to first make the call and then create the code itself ? I don’t know :) you can change the other if this bugs your brain… hehehe.

5. create the code to load the data and hide it.

<script>
function addData(){
$(‘#data_item’).load(‘mytable.html’);
$(‘#data_item’).show();
}

function hideData(){
$(‘#data_item’).hide();
}
</script>

6. dont forget to include the jquery library in your page:

<script src=”jquery-1.2.6.js”></script>

Now that you followed the steps and didn’t work, lets go step by step in the jquery code :)

this snipet of code $(‘#data_item’) selects the elements that have the id=data_item, to selec elements by the class would be something like $(‘.data_item’) but in this case we want to deal with only one item, that has the ID=data_item, so we use the # in the string selector.

the function load() is used to make a remote call to an URL and load, as the name says, the content of the URL in the selected element, it could be a DIV, a SPAN, All the content of a table, but in this case we are loading in a TD.

Ok, you followed the steps, read the step by step, and still not working …go ahead and grab the SOURCE, for your convenience the jquery version that I used is inside the sample.

be happy.

ajax journey

November 23rd, 2007

Oh well, I have been making my feet wet on Ajax subject for some time … almost a year to say the true =) but now I decided to jump in the water ! hehehehe.

And get totally wet means choose one framework and move forward, to use it, and who knows help somehow in the development. After some tests, and lots of readings … I got 2 candidates : Dojo and Jquery.

Dojo, has good indications, and a support from IBM, this is goooood :)

Jquery, was suggested by a chief designer friend of mine (thanks Frank), and it’s pretty easy to use.

Of course I run to the Dojo way of life first, but the code began to got tooo complicated, and very hard to make things work… going to the second option, I got happilly surprised ! worked very well, out of the box, very simple and the documentation, do what it’s supposed to do : shows me the code !!

Now I’m in this direction : Jquery, cool solution !!

photo2album.net

July 14th, 2007

aha ! my new personal challenge is this nice web site ! where you will be able to get your pictures from flickr (for now just this source…) and build pdf albums ready to be printed … =)

there are some nice technologies that I´m dealing with…

Prototype – AJAX library for asyncronous  requests  http://www.prototypejs.org/learn

DHTML Suite – a set of cool dhtml widgets http://www.dhtmlgoodies.com/index.html?page=dhtml-suite

Grafic AJAX library (to create images on the fly … ) http://prototype-graphic.xilinus.com/

Cool visual effects in Ajax http://script.aculo.us/

Another Widgets collection http://openrico.org/rico/home.page

PDF Generation in PHP – http://www.fpdf.org/

Flickr Webservices documentation http://www.flickr.com/services/api/

ajax pra q te quero …

March 24th, 2007

Tem algum tempo que tenho mexido com esta tal de chama asincrona através de páginas web… até já fiz uma mini biblioteca para isto… uma em especial que tem me chamado a atenção eh o prototype pela sua simplicidade.

veja mais

http://www.prototypejs.org/learn/introduction-to-ajax