mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
datatable refresh prb when source is in CrLf instead of Lf :
* add a try/catch block in the JS code * properly escape string returned This can happen for example when checking out with git-svn on Windows with core.autocrlf=auto SVN:trunk[5089]
This commit is contained in:
@@ -606,7 +606,7 @@ EOF
|
|||||||
$iPageSize = ($iDefaultPageSize < 1) ? 1 : $iDefaultPageSize;
|
$iPageSize = ($iDefaultPageSize < 1) ? 1 : $iDefaultPageSize;
|
||||||
$iPageIndex = 1 + floor($iStart / $iPageSize);
|
$iPageIndex = 1 + floor($iStart / $iPageSize);
|
||||||
$sHtml = $this->GetPager($oPage, $iPageSize, $iDefaultPageSize, $iPageIndex);
|
$sHtml = $this->GetPager($oPage, $iPageSize, $iDefaultPageSize, $iPageIndex);
|
||||||
$oPage->add_ready_script("$('#pager{$this->iListId}').html('".str_replace("\n", ' ', addslashes($sHtml))."');");
|
$oPage->add_ready_script("$('#pager{$this->iListId}').html('".json_encode($sHtml)."');");
|
||||||
if ($iDefaultPageSize < 1)
|
if ($iDefaultPageSize < 1)
|
||||||
{
|
{
|
||||||
$oPage->add_ready_script("$('#pager{$this->iListId}').parent().hide()");
|
$oPage->add_ready_script("$('#pager{$this->iListId}').parent().hide()");
|
||||||
|
|||||||
@@ -91,9 +91,19 @@ $(function()
|
|||||||
}
|
}
|
||||||
// End of workaround
|
// End of workaround
|
||||||
|
|
||||||
me.element.find('.datacontents').html(data);
|
try {
|
||||||
// restore the sort order on columns
|
me.element.find('.datacontents').html(data);
|
||||||
me.element.find('table.listResults').trigger('fakesorton', [aCurrentSort]);
|
// restore the sort order on columns
|
||||||
|
me.element.find('table.listResults').trigger('fakesorton', [aCurrentSort]);
|
||||||
|
} catch (e) {
|
||||||
|
// ugly hacks for IE 8/9 first...
|
||||||
|
if (!window.console) console.error = {};
|
||||||
|
if (!window.console.error) {
|
||||||
|
console.error = function () {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
console.error("Can not inject data : "+data);
|
||||||
|
}
|
||||||
me.element.unblock();
|
me.element.unblock();
|
||||||
}, 'html' );
|
}, 'html' );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user