Refactor makegrid.js

This commit is contained in:
Aris Feryanto 2011-08-11 13:35:51 +08:00
parent e65fc63e71
commit ba5598a190
3 changed files with 1598 additions and 1492 deletions

File diff suppressed because it is too large Load Diff

View File

@ -94,16 +94,7 @@ $(document).ready(function() {
* @memberOf jQuery
*/
$("#sqlqueryresults").live('makegrid', function() {
$('#table_results').makegrid();
})
/**
* Attach the {@link refreshgrid} function to a custom event, which will be
* triggered manually everytime the table of results is manipulated
* @memberOf jQuery
*/
$("#sqlqueryresults").live('refreshgrid', function() {
$('#table_results').refreshgrid();
PMA_makegrid($('#table_results')[0]);
})
/**

13
sql.php
View File

@ -166,14 +166,19 @@ if (isset($_REQUEST['get_set_values']) && $_REQUEST['get_set_values'] == true) {
*/
if (isset($_REQUEST['set_col_prefs']) && $_REQUEST['set_col_prefs'] == true) {
$pmatable = new PMA_Table($table, $db);
$retval = false;
// set column order
$col_order = explode(',', $_REQUEST['col_order']);
$retval = $pmatable->setUiProp(PMA_Table::PROP_COLUMN_ORDER, $col_order, $_REQUEST['table_create_time']);
if (isset($_REQUEST['col_order'])) {
$col_order = explode(',', $_REQUEST['col_order']);
$retval = $pmatable->setUiProp(PMA_Table::PROP_COLUMN_ORDER, $col_order, $_REQUEST['table_create_time']);
}
// set column visibility
$col_visib = explode(',', $_REQUEST['col_visib']);
$retval &= $pmatable->setUiProp(PMA_Table::PROP_COLUMN_VISIB, $col_visib, $_REQUEST['table_create_time']);
if (isset($_REQUEST['col_visib'])) {
$col_visib = explode(',', $_REQUEST['col_visib']);
$retval &= $pmatable->setUiProp(PMA_Table::PROP_COLUMN_VISIB, $col_visib, $_REQUEST['table_create_time']);
}
PMA_ajaxResponse(NULL, ($retval == true));
}