[jquery-ui] Custom functions

2010-03-04 Thread tjohnson
Hi all,
First time using jquery and so far I love it. But I am having a bit of
an issue and I was hoping someone could point me in right direction. I
am using the tablesorter plugin for jquery and it works fine. But my
issue is I am loading the data using ajax, and I cant seem to get my
 to trigger jquery. if I fill out the data by hand in html it
works fine but when I load it with ajax nothing happens. I mean I can
see the data and the tablesorter works. Attach is my javascript,
hopefully someone can help.

$(document).ready(function(){
$("#usedcars").tablesorter();

$.getJSON("jsondata.php", function(data){
$.each(data.usedcars, function(i, user){
var tblRow = ""
+""+user.stocknumber+""
+""+user.make+""
+""+user.age+""
+""+user.year+""
+""+user.model+""
+""+user.engine+""
+""+user.trans+""
+""+user.color+""
+""+user.miles+""
+""+user.drive+""
+""+user.cost+""
+""+user.book+""
+""+user.retail+""
+""+user.backofbook+""
+""+user.location+""
+""
$(tblRow).appendTo("#usedcars tbody");
});
$("#usedcars").trigger("update");
var sorting = [[0,0]];
$("#usedcars").trigger("sorton",[sorting]);
$('tr').addClass('carDetails');
});

$(".carDetails").click(function(){
$(this).hide();
});
});

-- 
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en.



[jquery-ui] Custom functions

2009-08-27 Thread Ties

Im fairly new with using jQuery. I setted up a demo modal window that
parses a ajax call. At the return of the ajax call a javascript
function can be called. Here is a short demo:

$(function() {
tips = $("#validateTips");
function updateTips(t) {
tips.text(t).effect("highlight",{},1500);
}
function popper1() { alert('y'); }
$("#dialog_login").dialog({
bgiframe: true,
autoOpen: false,
height: 100,
modal: true,
buttons: {
'Login': function() {
ajaxObj.call('action=login' + 
ajaxObj.getForm('login'),
ajx_fill);
$(this).dialog('close');

},
'Annuleren': function() {
ajaxObj.call('action=login' + 
ajaxObj.getForm('login'),
ajx_fill);
// $(this).dialog('close');
}
},
close: function() {
allFields.val('').removeClass('ui-state-error');
},
plopper2: function() {
alert('x');
}
});
$('#login_button').click(function() {
$('#dialog_login').dialog('open');
})
});

in the return i can use: $('#dialog_login').dialog('close') but i want
to call a custom function like the plopper1 or plopper2 function.

I would also like to be able to use a custom function in a onChange
statement in my form.

Anybody?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~--~~~~--~~--~--~---