[jQuery] function to call ajax

2008-09-19 Thread wesbird

Hi,
  I've been work working jQuery for more than 4 month, and really love
it. There are still a lot thing I need to learn, here is one:
  I like to create a function, Get_MyData. test_ajax() alway return
undefine. what's wrong in my code, what's the proper way to do
this?

  Thank you very much for your time.

Wes

code:
//
function Get_MyData (para1)
{
var parameters = AjaxServer.aspx?para1= + para1;
$.getJSON(parameters, function(data) {
// error handle
if (!onError(data)) return ;
//
var retList = [];
$.each(data.data, function(i, xy) {
retList .push(option value=');
retList .push(xy.id);
retList .push(');
retList .push(xy.name);
retList .push(/option)
});

return str = retList .join();
});
 }

// test function
function test_ajax()
{
var str = Get_MyData(1);
alert (str);
}


[jQuery] thickbox bring my IE window back

2008-09-04 Thread wesbird

Hi,
  I just found this problem, I have a asp.net application, at client
side, I use thickbox to show some picture in a modal dialog box, kind
of. generally, when you click a link, my code will show a modal with
pictures in it. It works fine till today, when I click the link, whole
IE window go under other windows (Window Explorer, Outlook, ...). This
only happen if there is only tab in the IE. I use jQuery 1.2.6 and
thickbox with modification.
  What could be the reason?




Thanks,


Wes


[jQuery] Re: thickbox bring my IE window back

2008-09-04 Thread wesbird

I found the problem,
this.blur(); in tb_init
once I remove it. works fine


On Sep 4, 12:00 pm, wesbird [EMAIL PROTECTED] wrote:
 Hi,
   I just found this problem, I have a asp.net application, at client
 side, I use thickbox to show some picture in a modal dialog box, kind
 of. generally, when you click a link, my code will show a modal with
 pictures in it. It works fine till today, when I click the link, whole
 IE window go under other windows (Window Explorer, Outlook, ...). This
 only happen if there is only tab in the IE. I use jQuery 1.2.6 and
 thickbox with modification.
   What could be the reason?

 Thanks,

 Wes


[jQuery] select input in td not wokring, and disabled textbox centered

2008-06-27 Thread wesbird

Hi,
  I have this problem. check the code below
  when first checkbox unchecked will disable 2nd checkbox and textbox;
when 2nd checkbox unchecked will disable textbox.
  now 2nd checkbox works just fine, but I have problem to make 1st one
work.
  I use
$(this).parent().nextAll().attr('disabled', !$
(this).is(':checked'));
  which will disable 2nd checkbox and textbox, but I still can enter
in textbox, I knew it will disable TD instead of the INPUT inside.

  I also try
$(this).parent().find('input').attr('disabled', !$
(this).is(':checked'));
$(this).parent().nextAll('input').attr('disabled', !$
(this).is(':checked'));
  none of them works.

How I can make this work?


Thank you,

Wes

!-- Code Start--
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
html
head
titleNew Document /title
meta name=Generator content=EditPlus/
meta name=Author content=/
meta name=Keywords content=/
meta name=Description content=/

script type=text/javascript src=jquery.js/script

script type=text/javascript
  $(document).ready(function(){

// On/Off check box event
$(#tblACR td:first-child input).click(function() {
$(this).parent().nextAll().attr('disabled', !$
(this).is(':checked'));
});

// Zone associate check box Event
$(#tblACR td:nth-child(3) input:checkbox).click(function() {
$(this).next().attr(disabled, !$(this).is(:checked));
});

$(#acrzt1).val(R1 R2 R3);

});

/script

/head
body
table id=tblACR
tr
td
input id=acr1 type=checkbox /
/td
td class=desc
The siting of identical front elevation side by side
is prohibited
/td
td class=ArchZoneChk
input id=acrz1 type=checkbox /Zone associated
input type=text class=ArchZoneTxt id=acrzt1 //
td
/tr
/table
/body
/html
!-- Code End--


[jQuery] How to select all in same row but not current one

2008-06-09 Thread wesbird

Hi,
  I have table with checkbox in every td, if anyone checkbox checked,
I should disable all other checkbox in the same row. Now how I can
select all checkbox in the same row but not current one. Thank you?
  Is jQuery doc down today?




Thanks,


Wes


[jQuery] parent child select

2008-04-28 Thread wesbird

Hi,
  I tried to select all td in the same row from a td, so I tried,
  $(id).parent(  td)
  it does not work. How I can do it?


[jQuery] Re: large string performance problem with html or append function

2008-04-18 Thread wesbird

I thought I have a alert in gmail so I don't have to back here to
check if I have reply. obvious I'm wrong. I just found I have reply
till now. Thank you, Shawn and Brian, it  helps. I apologize about
post a big message. I will not do this again.



Wes

On Mar 27, 7:10 pm, Shawn [EMAIL PROTECTED] wrote:
 k, that was fun... not.  Trying to reply to your message and waiting,
 and waiting, and waiting for ThunderChicken to catch up... then do it
 again after deleting the large block of text... :)

 Any way... my question would be why you are using a string in the first
 place?

 A possible smarter alternative is to use a DOM object in memory.
 Something like this:

 var myTable = $(table/table);
 for (var x = 0; x  json.length; x++) {
var row = $(tr/tr);
row.append(tdmy stuff:  + json[x] + /td);
myTable.append(row);

 }

 $(body).append(myTable);

 Now, this will do nothing for the sheer volume of data you are dealing
 with.  But it gets rid of the string and creates DOM objects
 immediately.  So, the overall processing *should* be a little faster.

 The other option is to NOT show so much data, but to introduce paging,
 or a smart scroll that will only load data as needed...  But dealing
 with large volumes are always troublesome.  a 7 or 8 second turnaround
 isn't tooo bad.  I have one page that is closer to 30 seconds (customer
 asked for it though - wider date range = more data = more time).  The
 point is that when large volumes are being dealt with, a delay is
 expected.  We *should* try to eliminate the delays where we can, but

 HTH

 Shawn

 wesbirdwrote:
  Hi
I just start use jQuery about 2 month ago, so please bear with me if
  I ask some question which already answered.
I'm working a ajax project, I use JSON to get result from server and
  then generate a table on the fly. the problem I have is, my end table
  string is huge, length is 935895.
$(#m).html( str ); take
  about 7000-8000ms
var m = document.getElementById(m);
m.innerHTML = str;  tabke about 2000-3000ms

m is div, str is my test string.

Is there something wrong? How I can improve it?
Thank you very much.


[jQuery] round corner slideout

2008-04-18 Thread wesbird

Hi,
  I just start use jQuery for about 3 month. It really save me a lot
of work.
  Now I have this problem, I have a div with 4 round corner. I made by
picture. there are all kind elements inside, dropdown list, button,
list, textarea, checkbox, ...
  Now we decide to change it to this, initially it will collapse with
only title show up, when you click a image in the title, it will
expand to full size. It will save a lot space for beneath datagrid.
  the problem is, we would like to still show 4 round corner when it
collapse as title, and expand as full size.
  I'm looking in the corner plugin.
  How to implment it? I really appreciate your help


  Thank you very much and have a nice weekend.



Wes






[jQuery] local the row and col of big table

2008-03-27 Thread wesbird

Hi,
  I have a big table in my page, how I can know which row/col when I
click a cell?

Thank you,


Wes