Jquery UI Portlets - Loading and Editing portlet using Ajax
All,
I am trying to create an igoogle interface using PHP, MySQL and JQuery UI and I stumbled on jquery UI's portlets over here:
http://jqueryui.com/demos/sortable/portlets.html
For each portle开发者_如何学运维t, is there a way:
- To specify a URL and load ajax content?
- To have an edit button, that will edit the portlet in place. The editing content can come through a URL using ajax.
For additional details,look at "Edit" functionality here:
http://james.padolsey.com/demo/tut-inettuts-with-cookies/
Thanks
You can change the content of the portlets with something like this example:
http://jsbin.com/imese4/2
You could use load() instead of .html() (used in the example for simplicity).
$(".portlet").each(function(element){
$(this).children(".portlet-content").load("content.php?id="+element);
});
To edit the content do something like this:
$(".portlet-edit").click(function(element){
s=prompt('Enter your content','Content');
$(this).parent().children(".portlet-content").html("edited:" + s);
});
精彩评论