mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°4481 Fix created elements on 1-n disappearing when table is redrawn
This commit is contained in:
@@ -474,6 +474,33 @@ HTML
|
||||
}
|
||||
return $oPage->GetTableRow($aRow, $aAttribs);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param WebPage $oPage
|
||||
* @param $sRealClass
|
||||
* @param $aValues
|
||||
* @param int $iTempId
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function GetFormRow($oPage, $sRealClass, $aValues, $iTempId)
|
||||
{
|
||||
if ($sRealClass == '')
|
||||
{
|
||||
$sRealClass = $this->sLinkedClass;
|
||||
}
|
||||
$oLinkObj = new $sRealClass();
|
||||
$oLinkObj->UpdateObjectFromPostedForm($this->sInputid);
|
||||
|
||||
$aAttribs = $this->GetTableConfig();
|
||||
$aRow = array();
|
||||
$aRow[] = '<input type="checkbox" class="selectList'.$this->sInputid.'" value="'.($iTempId).'"/>';
|
||||
foreach($this->aZlist as $sLinkedAttCode)
|
||||
{
|
||||
$aRow[] = $oLinkObj->GetAsHTML($sLinkedAttCode);
|
||||
}
|
||||
return $aRow;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the default search parameters based on 1) a 'current' object and 2) the silos defined by the context
|
||||
|
||||
@@ -484,9 +484,9 @@ $(function()
|
||||
this.indicator.html('<img src="../images/indicator.gif">');
|
||||
|
||||
$.post(this.options.submit_to, oParams, function(data){
|
||||
me.datatable.find('tbody').append(data);
|
||||
// From data variable we get data entry and insert the first (and only) one
|
||||
me.datatable.DataTable().row.add(data.data[0]).draw();
|
||||
$('#datatable_'+me.id+' .dataTables_empty').hide();
|
||||
//$('#linkedset_'+me.id+' .listResults tbody').append(data);
|
||||
|
||||
me._updateTable();
|
||||
me.indicator.html('');
|
||||
|
||||
@@ -224,7 +224,7 @@ try
|
||||
|
||||
// ui.linksdirectwidget
|
||||
case 'getLinksetRow':
|
||||
$oPage->SetContentType('text/html');
|
||||
$oPage = new JsonPage();
|
||||
$sClass = utils::ReadParam('class', '', false, 'class');
|
||||
$sRealClass = utils::ReadParam('real_class', '', false, 'class');
|
||||
$sAttCode = utils::ReadParam('att_code', '');
|
||||
@@ -233,7 +233,7 @@ try
|
||||
$aValues = utils::ReadParam('values', array(), false, 'raw_data');
|
||||
$oPage->SetContentType('text/html');
|
||||
$oWidget = new UILinksWidgetDirect($sClass, $sAttCode, $iInputId);
|
||||
$oPage->add($oWidget->GetRow($oPage, $sRealClass, $aValues, -$iTempId));
|
||||
$oPage->AddData($oWidget->GetFormRow($oPage, $sRealClass, $aValues, -$iTempId));
|
||||
break;
|
||||
|
||||
// ui.linksdirectwidget
|
||||
|
||||
Reference in New Issue
Block a user