商品规格模板优化
parent
002fe9538d
commit
e8a3fe2cb3
|
|
@ -735,6 +735,15 @@ $(function()
|
||||||
data: {"category_ids": value},
|
data: {"category_ids": value},
|
||||||
success: function(result)
|
success: function(result)
|
||||||
{
|
{
|
||||||
|
// 移除现有模板
|
||||||
|
$spec_quick.find('select option').each(function(k, v)
|
||||||
|
{
|
||||||
|
if(k > 0)
|
||||||
|
{
|
||||||
|
$(this).remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 循环处理得到的最新模板
|
||||||
if((result.data || null) != null && result.data.length > 0)
|
if((result.data || null) != null && result.data.length > 0)
|
||||||
{
|
{
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
@ -743,15 +752,8 @@ $(function()
|
||||||
html += '<option value="'+result.data[i]['content']+'">'+result.data[i]['name']+'</option>';
|
html += '<option value="'+result.data[i]['content']+'">'+result.data[i]['name']+'</option>';
|
||||||
}
|
}
|
||||||
$spec_quick.find('select').append(html);
|
$spec_quick.find('select').append(html);
|
||||||
} else {
|
|
||||||
$spec_quick.find('select option').each(function(k, v)
|
|
||||||
{
|
|
||||||
if(k > 0)
|
|
||||||
{
|
|
||||||
$(this).remove();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
// 更新select组件
|
||||||
$spec_quick.find('select').trigger('chosen:updated');
|
$spec_quick.find('select').trigger('chosen:updated');
|
||||||
},
|
},
|
||||||
error: function(xhr, type)
|
error: function(xhr, type)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue