File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4949 }
5050 */
5151 } ,
52+ advSearchFields : {
53+ name : { label : 'Name' } ,
54+ zoneid : {
55+ label : 'Zone' ,
56+ select : function ( args ) {
57+ $ . ajax ( {
58+ url : createURL ( 'listZones' ) ,
59+ data : {
60+ listAll : true
61+ } ,
62+ success : function ( json ) {
63+ var zones = json . listzonesresponse . zone ;
64+
65+ args . response . success ( {
66+ data : $ . map ( zones , function ( zone ) {
67+ return {
68+ id : zone . id ,
69+ description : zone . name
70+ } ;
71+ } )
72+ } ) ;
73+ }
74+ } ) ;
75+ }
76+ }
77+ } ,
5278
5379 // List view actions
5480 actions : {
270296 } ,
271297
272298 dataProvider : function ( args ) {
273- var array1 = [ ] ;
299+ var array1 = [ ] ;
274300 if ( args . filterBy != null ) {
275301 if ( args . filterBy . advSearch != null && typeof ( args . filterBy . advSearch ) == "object" ) {
276302 for ( var key in args . filterBy . advSearch ) {
277- array1 . push ( "&" + key + "=" + args . filterBy . advSearch [ key ] ) ;
303+ if ( args . filterBy . advSearch [ key ] != null && args . filterBy . advSearch [ key ] . length > 0 )
304+ array1 . push ( "&" + key + "=" + args . filterBy . advSearch [ key ] ) ;
278305 }
279306 }
280307 else if ( args . filterBy . search != null && args . filterBy . search . by != null && args . filterBy . search . value != null ) {
Original file line number Diff line number Diff line change 13901390 ) ;
13911391 } ;
13921392
1393- $listView . find ( '.button.search#advanced_search' ) . bind ( 'click' , function ( event ) {
1393+ $listView . find ( '.button.search#advanced_search' ) . bind ( 'click' , function ( event ) {
13941394 cloudStack . dialog . createForm ( {
13951395 form : {
13961396 title : 'Advanced Search' ,
1397- fields : {
1398- name : { label : 'Name' }
1399- }
1397+ fields : listViewData . advSearchFields
14001398 } ,
14011399 after : function ( args ) {
14021400 advancedSearch ( args ) ;
You can’t perform that action at this time.
0 commit comments