Showing
1 changed file
with
8 additions
and
5 deletions
@@ -239,9 +239,13 @@ | @@ -239,9 +239,13 @@ | ||
239 | <script> | 239 | <script> |
240 | var tagTypes = eval(${tagTypeMapJson}); | 240 | var tagTypes = eval(${tagTypeMapJson}); |
241 | 241 | ||
242 | - function refreshTagsByType(parentId){ | 242 | + function refreshTagsByType(parentId,tagTypeTmp){ |
243 | + console.log("parentId is "+parentId); | ||
243 | $("#parentTagDiv").html(""); | 244 | $("#parentTagDiv").html(""); |
244 | var tagType=$("#model_tagType").val(); | 245 | var tagType=$("#model_tagType").val(); |
246 | + if(tagTypeTmp!=null&&tagTypeTmp!=""){ | ||
247 | + tagType=tagTypeTmp; | ||
248 | + } | ||
245 | $.ajax({ | 249 | $.ajax({ |
246 | url : contextPath +"hostInfoList/getHostTagsByType?type="+tagType, | 250 | url : contextPath +"hostInfoList/getHostTagsByType?type="+tagType, |
247 | type : 'post', | 251 | type : 'post', |
@@ -252,19 +256,19 @@ | @@ -252,19 +256,19 @@ | ||
252 | selectHtml += '<option value="">---------</option>'; | 256 | selectHtml += '<option value="">---------</option>'; |
253 | for(var jj=0;jj<respone.data.length;jj++){ | 257 | for(var jj=0;jj<respone.data.length;jj++){ |
254 | selectHtml += '<option '; | 258 | selectHtml += '<option '; |
255 | - if(parentId!=null&&parentId>0&&parentId==respone.data[jj].id){ | 259 | + if(parentId>0&&parentId==respone.data[jj].id){ |
256 | selectHtml += ' selected=true '; | 260 | selectHtml += ' selected=true '; |
257 | } | 261 | } |
258 | selectHtml += ' value="'+respone.data[jj].id +'">'+ respone.data[jj].text+'</option>'; | 262 | selectHtml += ' value="'+respone.data[jj].id +'">'+ respone.data[jj].text+'</option>'; |
259 | } | 263 | } |
260 | selectHtml += '</select>'; | 264 | selectHtml += '</select>'; |
265 | + console.log(selectHtml); | ||
261 | $("#parentTagDiv").html(selectHtml); | 266 | $("#parentTagDiv").html(selectHtml); |
262 | } | 267 | } |
263 | }); | 268 | }); |
264 | } | 269 | } |
265 | 270 | ||
266 | function createTreeGrid(e){ | 271 | function createTreeGrid(e){ |
267 | - console.log(e); | ||
268 | var config = { | 272 | var config = { |
269 | id : "id", | 273 | id : "id", |
270 | width : "800", | 274 | width : "800", |
@@ -325,7 +329,6 @@ | @@ -325,7 +329,6 @@ | ||
325 | data: {'searchContent': content,'tagTypeContent':$.trim($("#tagType").val())}, | 329 | data: {'searchContent': content,'tagTypeContent':$.trim($("#tagType").val())}, |
326 | dataType: 'json', | 330 | dataType: 'json', |
327 | success: function (resp) { | 331 | success: function (resp) { |
328 | - console.log(resp); | ||
329 | createTreeGrid(resp.data); | 332 | createTreeGrid(resp.data); |
330 | }, | 333 | }, |
331 | error: function (resp) { | 334 | error: function (resp) { |
@@ -345,7 +348,7 @@ | @@ -345,7 +348,7 @@ | ||
345 | } | 348 | } |
346 | //打开新增或修改页面 | 349 | //打开新增或修改页面 |
347 | function editHostGroup(id, pid,groupName,tagType,descr) { | 350 | function editHostGroup(id, pid,groupName,tagType,descr) { |
348 | - refreshTagsByType(pid); | 351 | + refreshTagsByType(pid,tagType); |
349 | 352 | ||
350 | $("#hostGroupForm #messageAlert").hide(); | 353 | $("#hostGroupForm #messageAlert").hide(); |
351 | if (id == 0) {//新增页面 | 354 | if (id == 0) {//新增页面 |
-
Please register or login to post a comment