mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01: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;
|
||||
$iPageIndex = 1 + floor($iStart / $iPageSize);
|
||||
$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)
|
||||
{
|
||||
$oPage->add_ready_script("$('#pager{$this->iListId}').parent().hide()");
|
||||
|
||||
@@ -91,9 +91,19 @@ $(function()
|
||||
}
|
||||
// End of workaround
|
||||
|
||||
me.element.find('.datacontents').html(data);
|
||||
// restore the sort order on columns
|
||||
me.element.find('table.listResults').trigger('fakesorton', [aCurrentSort]);
|
||||
try {
|
||||
me.element.find('.datacontents').html(data);
|
||||
// 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();
|
||||
}, 'html' );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user