* [bug#37402,done,0.2h] move js to common and set renderRowData.
This commit is contained in:
@@ -1,42 +1,3 @@
|
||||
window.setModuleAndPlanByBranch = function(e)
|
||||
{
|
||||
const $branch = $(e.target);
|
||||
const branchID = $branch.val();
|
||||
let $row = $branch.closest('tr');
|
||||
|
||||
var moduleLink = $.createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&extra=nodeleted');
|
||||
|
||||
while($row.length)
|
||||
{
|
||||
const $modulePicker = $row.find('[name^=module]').zui('picker');
|
||||
const moduleID = $row.find('[name^=module]').val();
|
||||
$.getJSON(moduleLink, function(data)
|
||||
{
|
||||
$modulePicker.render({items: data.items})
|
||||
$modulePicker.$.setValue(moduleID);
|
||||
});
|
||||
|
||||
$row = $row.next('tr');
|
||||
if(!$row.find('td[data-name="module"][data-ditto="on"]').length) break;
|
||||
}
|
||||
|
||||
var planLink = $.createLink('productPlan', 'ajaxGetProductPlans', 'productID=' + productID + '&branch=' + branchID);
|
||||
let $rows = $branch.closest('tr');
|
||||
while($rows.length)
|
||||
{
|
||||
const $planPicker = $rows.find('[name^=plan]').zui('picker');
|
||||
const planID = $rows.find('[name^=plan]').val();
|
||||
$.getJSON(planLink, function(data)
|
||||
{
|
||||
$planPicker.render({items: data})
|
||||
$planPicker.$.setValue(planID);
|
||||
});
|
||||
|
||||
$rows = $rows.next('tr');
|
||||
if(!$rows.find('td[data-name="plan"][data-ditto="on"]').length) break;
|
||||
}
|
||||
}
|
||||
|
||||
window.changeRegion = function(e)
|
||||
{
|
||||
const $region = $(e.target);
|
||||
|
||||
@@ -134,3 +134,42 @@ window.loadBranch = function()
|
||||
window.loadBranchModule(productID);
|
||||
window.loadURS();
|
||||
};
|
||||
|
||||
window.setModuleAndPlanByBranch = function(e)
|
||||
{
|
||||
const $branch = $(e.target);
|
||||
const branchID = $branch.val();
|
||||
let $row = $branch.closest('tr');
|
||||
|
||||
var moduleLink = $.createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&extra=nodeleted');
|
||||
|
||||
while($row.length)
|
||||
{
|
||||
const $modulePicker = $row.find('[name^=module]').zui('picker');
|
||||
const moduleID = $row.find('[name^=module]').val();
|
||||
$.getJSON(moduleLink, function(data)
|
||||
{
|
||||
$modulePicker.render({items: data.items})
|
||||
$modulePicker.$.setValue(moduleID);
|
||||
});
|
||||
|
||||
$row = $row.next('tr');
|
||||
if(!$row.find('td[data-name="module"][data-ditto="on"]').length) break;
|
||||
}
|
||||
|
||||
var planLink = $.createLink('productPlan', 'ajaxGetProductPlans', 'productID=' + productID + '&branch=' + branchID);
|
||||
let $rows = $branch.closest('tr');
|
||||
while($rows.length)
|
||||
{
|
||||
const $planPicker = $rows.find('[name^=plan]').zui('picker');
|
||||
const planID = $rows.find('[name^=plan]').val();
|
||||
$.getJSON(planLink, function(data)
|
||||
{
|
||||
$planPicker.render({items: data})
|
||||
$planPicker.$.setValue(planID);
|
||||
});
|
||||
|
||||
$rows = $rows.next('tr');
|
||||
if(!$rows.find('td[data-name="plan"][data-ditto="on"]').length) break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ else
|
||||
set::data(array_values($datas)),
|
||||
set::actions(array()),
|
||||
set::showExtra(false),
|
||||
set::onRenderRow(jsRaw('renderRowData')),
|
||||
div
|
||||
(
|
||||
setClass('toolbar form-actions form-group no-label'),
|
||||
@@ -108,6 +109,13 @@ else
|
||||
{
|
||||
$('#importNoticeModal [name=insert]').val(type == 'insert' ? 1 : 0);
|
||||
};
|
||||
window.renderRowData = function(\$row, index, row)
|
||||
{
|
||||
if(typeof renderImportRowData == 'function')
|
||||
{
|
||||
renderImportRowData(\$row, index, row);
|
||||
}
|
||||
}
|
||||
JAVASCRIPT);
|
||||
css('.form-batch-container .form-batch-control .check-list-inline {padding-top: 0;}');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user