File tree 3 files changed +17
-3
lines changed
3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -135,8 +135,13 @@ define([
135
135
if ( ! options . id ) {
136
136
options . id = 'attrTab-' + options . topicID ;
137
137
}
138
+ if ( typeof options . closable == 'undefined' ) {
139
+ options . closable = true ;
140
+ }
141
+ if ( typeof options . confirmClose == 'undefined' ) {
142
+ options . confirmClose = true ;
143
+ }
138
144
options . map = this . map ;
139
- options . closable = true ;
140
145
options . sidebarID = this . sidebarID ;
141
146
142
147
if ( this . useTabs ) {
@@ -154,7 +159,7 @@ define([
154
159
tab . startup ( ) ;
155
160
tabs . addChild ( tab ) ;
156
161
tab . onClose = lang . hitch ( tab , function ( ) {
157
- var close = confirm ( 'Do you really want to close this tab?' ) ;
162
+ var close = this . confirmClose ? confirm ( 'Do you really want to close this tab?' ) : true ;
158
163
if ( close && this . clearAll ) {
159
164
this . clearAll ( ) ;
160
165
}
Original file line number Diff line number Diff line change @@ -93,6 +93,11 @@ define({
93
93
// other instances of attributes table
94
94
topicID: ' query' ,
95
95
96
+ // allow tabs to be closed
97
+ // confirm tab closure
98
+ closable: true ,
99
+ confirmClose: true ,
100
+
96
101
queryOptions: {
97
102
// parameters for the query
98
103
queryParameters: {
@@ -225,7 +230,7 @@ gridOptions: {
225
230
columns: [],
226
231
227
232
/*
228
- no sort
233
+ no sort, use sort: 'inherit' to use the order of the query results.
229
234
*/
230
235
sort: [],
231
236
Original file line number Diff line number Diff line change @@ -251,6 +251,10 @@ define([
251
251
252
252
// set the sort
253
253
var sort = this . gridOptions . sort || [ ] ;
254
+ // sort === 'inherit'? use query result order
255
+ if ( typeof sort === 'string' && sort . toLowerCase ( ) === 'inherit' ) {
256
+ return ;
257
+ }
254
258
// no sort? use the first column
255
259
if ( sort . length < 1 && columns && columns . length > 0 ) {
256
260
sort = [
You can’t perform that action at this time.
0 commit comments