File tree Expand file tree Collapse file tree
java/com/amitshekhar/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ function getDBList() {
8181
8282}
8383
84+ var lastTableName = getHashValue ( 'table' ) ;
8485function openDatabaseAndGetTableList ( db ) {
8586
8687 if ( "APP_SHARED_PREFERENCES" == db ) {
@@ -110,10 +111,14 @@ function openDatabaseAndGetTableList(db) {
110111 }
111112 $ ( '#table-list' ) . empty ( )
112113 for ( var count = 0 ; count < tableList . length ; count ++ ) {
113- var tableName = tableList [ count ] ;
114- $ ( "#table-list" ) . append ( "<a href='#' data-db-name='" + db + "' data-table-name='" + tableName + "' class='list-group-item' onClick='getData(\"" + tableName + "\");'>" + tableName + "</a>" ) ;
115- }
116-
114+ var tableName = tableList [ count ] ;
115+ $ ( "#table-list" ) . append ( "<a href='#table=" + tableName + "' data-db-name='" + db + "' data-table-name='" + tableName
116+ + "' class='list-group-item' onClick='getData(\"" + tableName + "\");'>" + tableName + "</a>" ) ;
117+ }
118+
119+ if ( lastTableName !== null ) {
120+ $ ( 'a[data-table-name=' + lastTableName + ']' ) . trigger ( 'click' ) ;
121+ }
117122 } } ) ;
118123
119124}
@@ -389,3 +394,8 @@ function showErrorInfo(message){
389394 snackbarElement . removeClass ( "show" ) ;
390395 } , 3000 ) ;
391396}
397+
398+ function getHashValue ( key ) {
399+ var matches = location . hash . match ( new RegExp ( key + '=([^&]*)' ) ) ;
400+ return matches ? matches [ 1 ] : null ;
401+ }
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ private DatabaseHelper() {
4646
4747 public static Response getAllTableName (SQLiteDatabase database ) {
4848 Response response = new Response ();
49- Cursor c = database .rawQuery ("SELECT name FROM sqlite_master WHERE type='table' OR type='view'" , null );
49+ Cursor c = database .rawQuery ("SELECT name FROM sqlite_master WHERE type='table' OR type='view' ORDER BY name COLLATE NOCASE " , null );
5050 if (c .moveToFirst ()) {
5151 while (!c .isAfterLast ()) {
5252 response .rows .add (c .getString (0 ));
You can’t perform that action at this time.
0 commit comments