|
907 | 907 | } |
908 | 908 | }, |
909 | 909 |
|
| 910 | + advSearchFields: { |
| 911 | + name: { label: 'Name' }, |
| 912 | + zoneid: { |
| 913 | + label: 'Zone', |
| 914 | + select: function(args) { |
| 915 | + $.ajax({ |
| 916 | + url: createURL('listZones'), |
| 917 | + data: { |
| 918 | + listAll: true |
| 919 | + }, |
| 920 | + success: function(json) { |
| 921 | + var zones = json.listzonesresponse.zone; |
| 922 | + |
| 923 | + args.response.success({ |
| 924 | + data: $.map(zones, function(zone) { |
| 925 | + return { |
| 926 | + id: zone.id, |
| 927 | + description: zone.name |
| 928 | + }; |
| 929 | + }) |
| 930 | + }); |
| 931 | + } |
| 932 | + }); |
| 933 | + } |
| 934 | + }, |
| 935 | + tagKey: { label: 'Tag Key' }, |
| 936 | + tagValue: { label: 'Tag Value' } |
| 937 | + }, |
| 938 | + |
910 | 939 | dataProvider: function(args) { |
911 | | - var array1 = []; |
| 940 | + var data = {}; |
| 941 | + listViewDataProvider(args, data); |
| 942 | + |
912 | 943 | var ignoreProject = false; |
913 | | - if(args.filterBy != null) { |
| 944 | + if(args.filterBy != null) { //filter dropdown |
914 | 945 | if(args.filterBy.kind != null) { |
915 | 946 | switch(args.filterBy.kind) { |
916 | 947 | case "all": |
917 | 948 | ignoreProject = true; |
918 | | - array1.push("&isofilter=all"); |
| 949 | + $.extend(data, { |
| 950 | + isofilter: 'all' |
| 951 | + }); |
919 | 952 | break; |
920 | 953 | case "mine": |
921 | | - array1.push("&isofilter=self"); |
| 954 | + $.extend(data, { |
| 955 | + isofilter: 'self' |
| 956 | + }); |
922 | 957 | break; |
923 | 958 | case "featured": |
924 | 959 | ignoreProject = true; |
925 | | - array1.push("&isofilter=featured"); |
| 960 | + $.extend(data, { |
| 961 | + isofilter: 'featured' |
| 962 | + }); |
926 | 963 | break; |
927 | 964 | case "community": |
928 | 965 | ignoreProject = true; |
929 | | - array1.push("&isofilter=community"); |
930 | | - break; |
931 | | - } |
932 | | - } |
933 | | - if(args.filterBy.search != null && args.filterBy.search.by != null && args.filterBy.search.value != null) { |
934 | | - switch(args.filterBy.search.by) { |
935 | | - case "name": |
936 | | - if(args.filterBy.search.value.length > 0) |
937 | | - array1.push("&keyword=" + args.filterBy.search.value); |
| 966 | + $.extend(data, { |
| 967 | + isofilter: 'community' |
| 968 | + }); |
938 | 969 | break; |
939 | 970 | } |
940 | | - } |
941 | | - } |
| 971 | + } |
| 972 | + } |
942 | 973 |
|
943 | 974 | $.ajax({ |
944 | | - url: createURL("listIsos&page=" + args.page + "&pagesize=" + pageSize + array1.join(""), { ignoreProject: ignoreProject }), |
945 | | - dataType: "json", |
946 | | - async: true, |
| 975 | + url: createURL('listIsos', { ignoreProject: ignoreProject }), |
| 976 | + data: data, |
947 | 977 | success: function(json) { |
948 | 978 | var items = json.listisosresponse.iso; |
949 | 979 | args.response.success({ |
|
0 commit comments