* Adjust program productview link.
This commit is contained in:
@@ -64,13 +64,14 @@ $config->program->productview->dtable->fieldList = array();
|
||||
|
||||
$config->program->productview->dtable->fieldList['name']['name'] = 'name';
|
||||
$config->program->productview->dtable->fieldList['name']['title'] = $lang->nameAB;
|
||||
$config->program->productview->dtable->fieldList['name']['type'] = 'title';
|
||||
$config->program->productview->dtable->fieldList['name']['type'] = 'link';
|
||||
$config->program->productview->dtable->fieldList['name']['iconRender'] = 'RAWJS<function(value, row){return window.iconRenderProductView(value, row);}>RAWJS';
|
||||
$config->program->productview->dtable->fieldList['name']['link'] = array('module' => 'product', 'method' => 'browse', 'params' => 'productID={id}');
|
||||
$config->program->productview->dtable->fieldList['name']['link'] = "RAWJS<function(info){const {row, col} = info; console.log(info); if(row.data.type == 'product') return {url:$.createLink('product', 'browse', 'productID=' + row.data.id)}; if(row.data.type == 'program') return {url:$.createLink('program', 'view', 'programID=' + row.data.id.replace('program-', ''))};}>RAWJS";
|
||||
$config->program->productview->dtable->fieldList['name']['nestedToggle'] = true;
|
||||
$config->program->productview->dtable->fieldList['name']['checkbox'] = true;
|
||||
$config->program->productview->dtable->fieldList['name']['show'] = true;
|
||||
$config->program->productview->dtable->fieldList['name']['sortType'] = true;
|
||||
$config->program->productview->dtable->fieldList['name']['minWidth'] = 350;
|
||||
$config->program->productview->dtable->fieldList['name']['group'] = 'g1';
|
||||
|
||||
$config->program->productview->dtable->fieldList['PM']['name'] = 'PM';
|
||||
@@ -195,7 +196,7 @@ $config->program->projectView->dtable->fieldList['name']['name'] = 'name
|
||||
$config->program->projectView->dtable->fieldList['name']['title'] = $lang->nameAB;
|
||||
$config->program->projectView->dtable->fieldList['name']['width'] = 200;
|
||||
$config->program->projectView->dtable->fieldList['name']['type'] = 'link';
|
||||
$config->program->projectView->dtable->fieldList['name']['link'] = "RAWJS<function(info){const {row, col} = info; if(row.data.type == 'project') return {url:$.createLink('project', 'browse', 'projectID={id}')}; if(row.data.type == 'program') return {url:$.createLink('program', 'view', 'programID={id}')};}>RAWJS";
|
||||
$config->program->projectView->dtable->fieldList['name']['link'] = "RAWJS<function(info){const {row, col} = info; console.log(row); if(row.data.type == 'project') return {url:$.createLink('project', 'browse', 'projectID=' + row.data.id)}; if(row.data.type == 'program') return {url:$.createLink('program', 'view', 'programID=' + row.data.id)};}>RAWJS";
|
||||
$config->program->projectView->dtable->fieldList['name']['flex'] = 1;
|
||||
$config->program->projectView->dtable->fieldList['name']['nestedToggle'] = true;
|
||||
$config->program->projectView->dtable->fieldList['name']['checkbox'] = true;
|
||||
@@ -329,7 +330,7 @@ $config->program->browse->dtable->fieldList['name']['name'] = 'name';
|
||||
$config->program->browse->dtable->fieldList['name']['title'] = $lang->nameAB;
|
||||
$config->program->browse->dtable->fieldList['name']['width'] = 200;
|
||||
$config->program->browse->dtable->fieldList['name']['type'] = 'link';
|
||||
$config->program->browse->dtable->fieldList['name']['link'] = "RAWJS<function(info){const {row, col} = info; if(row.data.type == 'project') return {url:$.createLink('project', 'browse', 'projectID={id}')}; if(row.data.type == 'program') return {url:$.createLink('program', 'view', 'programID={id}')};}>RAWJS";
|
||||
$config->program->browse->dtable->fieldList['name']['link'] = "RAWJS<function(info){const {row, col} = info; if(row.data.type == 'project') return {url:$.createLink('project', 'browse', 'projectID=' + row.data.id)}; if(row.data.type == 'program') return {url:$.createLink('program', 'view', 'programID=' + row.data.id)};}>RAWJS";
|
||||
$config->program->browse->dtable->fieldList['name']['flex'] = 1;
|
||||
$config->program->browse->dtable->fieldList['name']['nestedToggle'] = true;
|
||||
$config->program->browse->dtable->fieldList['name']['checkbox'] = true;
|
||||
|
||||
@@ -15,23 +15,6 @@ window.renderCellProductView = function(result, {col, row})
|
||||
if(row.data.latestReleaseDate === '') return [''];
|
||||
}
|
||||
|
||||
if(col.name == 'name' && row.data.type !== 'product')
|
||||
{
|
||||
/* Remove class of checkbox. */
|
||||
result.splice(result.length - 1);
|
||||
|
||||
/* Remove checkbox. */
|
||||
result.forEach(function(ele, idx)
|
||||
{
|
||||
if(!ele.props.class) return;
|
||||
if(ele.props.class.includes('checkbox')) result.splice(idx, 1);
|
||||
});
|
||||
|
||||
result[result.length - 1] = row.data.name;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
if(col.name == 'totalProjects' && row.data.type !== 'product')
|
||||
{
|
||||
return [row.data.totalProjects];
|
||||
|
||||
@@ -305,6 +305,7 @@ dtable
|
||||
set::nested(true),
|
||||
set::className('shadow rounded'),
|
||||
set::footPager(usePager()),
|
||||
set::canRowCheckable(jsRaw("function(rowID){return this.getRowInfo(rowID).data.type == 'product';}")),
|
||||
set::onRenderCell(jsRaw('window.renderCellProductView')),
|
||||
set::footToolbar(array
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user