Jump to content

Going to a specific table row


gevensen

Recommended Posts

  • 2 weeks later...

i have tried

 

$("#reconcile_table tr:eq(45)");   

 

and

 

$("#reconcile_table tr:eq("+TableRow+")");   

 

where TableRow is a number taken from the last click on the row. I put it in a hidden field

then retrieve it for later use?

 

the funny thing is i can use an anchor href and it works I just want to do it as a result of the routine

 

the enitre jquery script is below

 

<script>function select_statement(id){
var Mydata = '';
var lastRow=document.getElementById('lastrow').value;
//alert(TableRow);
var db ="<?php echo $dbname; ?>";
var user ="<?php echo $_SESSION['username']; ?>";	
Mydata=Mydata+"id="+id;
Mydata=Mydata+"&account="+document.getElementById('bank_account').value;
Mydata=Mydata+"&db="+db;	
Mydata=Mydata+"&user="+user;
Mydata=Mydata+"&lastRow="+lastRow;
$("#statement_id").attr("value", id);
$("#account_selection_div").hide();
$("#reconcile_div").show();
$('#reconcile_div').html('<img src="../../sc/images/working.gif" height="20" width="20" />');
//alert(Mydata);
$.ajax( {
	url : 'reconcile/show_reconcile_ajax.php',
	type : 'post',
	data : Mydata,

	  		
	success : function( resp ) {
	var $response=$(resp);
    var reconciled = $response.find('#reconciled_response').html();
    var balance = $response.find('#balance_response').html();
    var i = $response.find('#i_response').html();
    $("#i_value").attr("value", i); // i is the row count in the reconcile table
    var $response=$(resp);
    var start = $response.find('#s_response').html();
    $("#statement_start").attr("value", start);
    var $response=$(resp);
    var end = $response.find('#e_response').html();
    $("#statement_end").attr("value", end);
    $('#reconcile_div').html($('#inner_reconcile_div', resp).html());
   
    if(reconciled>0){
	    // its reconciled
    	$('#button_table').hideColumns(1); // add expense button   
    	$('#button_table').hideColumns(2); // research
    $('#button_table').hideColumns(3); // reconcile button
    $('#button_table').showColumns(4); // reverse button
    $('#reconcile_table').hideColumns(2); // delete in reconcile table
    $('#reconcile_table').hideColumns(9); // edit in reconcile table
    $('#reconcile_table').hideColumns(11); // reconcile in reconcile table
    //alert("reconciled");
       	
    	
    	
    }
    if(reconciled<1){
        // its not reconciled
    	
    	$('#button_table').showColumns(1);	// add expense button
    	$('#button_table').showColumns(2);  // research
    	$('#button_table').hideColumns(3);  // default
    	if(balance<.01){
    	$('#button_table').showColumns(3);  }  // reconcile  
    	$('#button_table').hideColumns(4);  // reverse
    	$('#reconcile_table').showColumns(2); // delete in reconcile table
	    $('#reconcile_table').showColumns(9); // edit in reconcile table
	    $('#reconcile_table').showColumns(11); // reconcile in reconcile table
	    

	    
    }

    
	}
});
$("#reconcile_table tr:eq(45)"); 	 

}

</script>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.