Forum

HomeHomeCoreCoreGeneralGeneralDo any one know y my jquery code is not working?Do any one know y my jquery code is not working?
Previous
 
Next
New Post
7/21/2011 8:47 AM
 

Hi everyone,

My jquey block is not working.I tried it with different settings but it is not working.

Here is my code:

Query tempelate ----Has a select query

Header Tempelate:

<table width="" cellpadding="" cellspacing="">
    <tr>
        <td>[aMessage,Action]</td>
        <td><input type="button" value="Edit" id="Editbutton"/></td>
    </tr>
</table>
<table width="" cellpadding="" cellspacing="" id="listXTable[MODULEID]" >
    <tr Class="DataGrid_Header">
    <th>
        Suspense_File
    </th>
    <th>
        POPartNumber
    </th>
    <th>
        POPONumber
    </th>
    <th>
        TCLaborHours
    </th>
    <th>
        POInspectionHours
    </th>
    <th>
        TCServiceDate
    </th>
    <th>
        TCSupplierCode
    </th>
    <th>
        POLineItem
    </th>
    </tr>

Detail Tempelate:

<tr class="DataGrid_Item">
<td><a href="javascript:lxFetch(380,0,'TimeCardID=[ID]');lxModule(622,true);1XSort(380,0,'[ID]');">[ID]</a></td>
<td><a href="javascript:lxFetch(380,0,'PartNumber=[PartNo]');lxModule(622,true);">[PartNo]</a> </td>
<td><a href="javascript:lxFetch(380,0,'PONumber=[PONum]');lxModule(622,true);">[PONum]</a> </td>
<td>[TCLaborHours]</td>
<td class="alink"><a href="javascript:lxFetch(380,0,'Inspection=[Po]');lxModule(622,true);">[Po]</a></td>

<td>[TCServiceDate]</td>
<td>[TCSupplierCode]</td>
<td><a href="javascript:lxFetch(380,0,'LineItem=[LineI]');lxModule(622,true);">[LineI]</a></td>
 

Footer Tempelate:</table>

Control.Header:

<link href="http://ajax.googleapis.com/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text"/>
<script type="text/javascript" src="http://ajax.googleapis.com/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){   
     $jq('#Editbutton').click(function(){
        $jq('td.alink').hide();   
    });
     });
</script>

 

when the button in the header tempelate is clicked the td column in detail tempalate  eith id alink should be hided .

But it is doing nothing.

 

Any suggestions please.

 

 

Thanks,

Sravz

New Post
7/21/2011 9:28 AM
 

Hi Sravz

On this I'd firstly remove the line:

<script type="text/javascript" src="http://ajax.googleapis.com/libs/jquery/1.4/jquery.min.js"></script>

It is likely jQuery is already there.

I'd probably change the script to:

<script type="text/javascript">
jQuery(document).ready(function(){   
    
jQuery('#Editbutton').click(function(){
       
jQuery('span.alink').slideUp();   
    });
     });
</script>

I'm not sure on the hide though probably fine... I tend to use slideUp or fadeOut... hide might be fine. Main point here is you start with $(document) but then use $jq.  Either it is $ or $jq (noconflict).  I tend to stay away from noconflict and use jQuery so it is clear and doesn't have issues.

I also would not try to hide <td>... just a bad idea since it changes the table formatting.  I'd go with:

<td><span class="alink"><a href="javascript:lxFetch(380,0,'Inspection=[Po]');lxModule(622,true);">[Po]</a></span></td>

Does that help?

David

New Post
7/21/2011 9:33 AM
 

Just noticed the formatting of your Fetch.

I think it would be better to go with:

<a href="#" onclick="ows.Fetch([ModuleID,System],0,'Inspection=[Po]'); lxModule(622,true);">

I used [ModuleID,System] in there for the current module but if it's another I'd probably use a Query to get the module ID and place it but I wouldn't hardcode the ModuleID.  Pretty much never hardcode these references as it becomes harder when using different test/development sites, wanting to place the module elsewhere etc.

New Post
7/21/2011 12:50 PM
 
Hey david, That did work .Thanksfor the reply .I guess the mistake was with hiding the td. Thanks, Sravz
New Post
8/4/2011 1:53 PM
 

Hey david, I dont know what is wrong with my code.

Control.header code---------------------------

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

<script type="text/javascript">

$(document).ready(function(){

$('div').bind('click',function(){

$(".TableDisplay").show('fast');

});

});

</script>

 

 

please let me know.I tried to figure it out. In the above script if I just put it like this 'jQuery('div').bind('click',function(){' -------this works but i want id. html header and detail code here header code: Detail code Thanks, Sravanthi

Details CompanyDetailID Contact ID Description
Expand
[CONTACTDETAILID] [CONTACT_ID] [DECRIPTION]
Previous
 
Next
HomeHomeCoreCoreGeneralGeneralDo any one know y my jquery code is not working?Do any one know y my jquery code is not working?


 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seattle, WA • info@openwebstudio.com

Bookmark & Share Bookmark and Share