Michael24680
Member
Hello,
I have create a custom button and switch the status of my data with this code, where documented in the capitel "6.10. Custom buttons"
[pre]
function dadabik_change_status($table_name, $where_field, $where_value)
{
global $conn, $dadabik_main_file, $quote;
$sql = "UPDATE orders set status_order_user = 'approved' WHERE ".$quote.$where_field.$quote." = :where_value";
$res_prepare = prepare_db($conn, $sql);
$values_to_bind = array();
$values_to_bind['where_value'] = $where_value;
foreach ($values_to_bind as $key => $value)
{
$res_bind = bind_param_db($res_prepare, ':'.$key, $value);
}
$res = execute_prepared_db($res_prepare,0);
// let's go back to the results grid
header('Location:'.$dadabik_main_file.'?function=search&tablename='.urlencode($table_name));
exit;
}
[/pre]
This code works fine, but if I click to the button and then he refreshed data grid page, he jump to top of the page.
So if I have to change the status from multible lines e.g. row# 100, I must after every line scroll to the line 100+ and click the next button from the next line.
Can you tell me, how can I set the code, that he not jump to top of the page?
Regards
Michael
I have create a custom button and switch the status of my data with this code, where documented in the capitel "6.10. Custom buttons"
[pre]
function dadabik_change_status($table_name, $where_field, $where_value)
{
global $conn, $dadabik_main_file, $quote;
$sql = "UPDATE orders set status_order_user = 'approved' WHERE ".$quote.$where_field.$quote." = :where_value";
$res_prepare = prepare_db($conn, $sql);
$values_to_bind = array();
$values_to_bind['where_value'] = $where_value;
foreach ($values_to_bind as $key => $value)
{
$res_bind = bind_param_db($res_prepare, ':'.$key, $value);
}
$res = execute_prepared_db($res_prepare,0);
// let's go back to the results grid
header('Location:'.$dadabik_main_file.'?function=search&tablename='.urlencode($table_name));
exit;
}
[/pre]
This code works fine, but if I click to the button and then he refreshed data grid page, he jump to top of the page.
So if I have to change the status from multible lines e.g. row# 100, I must after every line scroll to the line 100+ and click the next button from the next line.
Can you tell me, how can I set the code, that he not jump to top of the page?
Regards
Michael