Issue
I have a grid that gets updated every 3 seconds. Everything working fine but the problem is that the loader (showing...loading) keeps on poping up everytime the grid is updated.
This is what I have tried:
echo DynaGrid::widget([
'columns' => $columns,
'showPersonalize' => true,
'options' => ['id' => 'trackyard'],
'gridOptions' => [
'options' => ['id' => 'assignsolicitation-inside'],
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'showPageSummary' => false,
'pager' => [
'firstPageLabel' => 'First',
'lastPageLabel' => 'Last',
'maxButtonCount' => 10,
],
'toolbar' => [
['content' => '{dynagrid}'],
'{export}',
'{toggleData}'
],
'pjax' => true,
'pjaxSettings' => [
'options' => [
'id' => 'wod'
],],
'bordered' => false,
'striped' => true,
'condensed' => true,
'responsive' => true,
'responsiveWrap' => false,
'containerOptions' => ['style' => 'overflow:scroll'],
]
]);
?>
Then after the grid I have:
<?php
$script = <<< JS
function reloadgrid() {
var intervalID = setInterval(function() {
$.pjax.reload({container:'#trackyard-pjax'});
}, 3000);
setTimeout(function() {
clearInterval(intervalID);
}, 18000);
};
reloadgrid();
JS;
$this->registerJS($script, \yii\web\VIEW::POS_HEAD);
?>
How can i hide the loader?
Solution
I found out that i needed to set loadingCssClass to false
That is
echo DynaGrid::widget([
'columns' => $columns,
'showPersonalize' => true,
'options' => ['id' => 'trackyard'],
'gridOptions' => [
'options' => ['id' => 'assignsolicitation-inside'],
....
'pjax' => true,
'pjaxSettings' => [
'options' => [
'id' => 'wod'
],
'loadingCssClass'=>false, //this disables the loading thing
],
.........
]
]);
?>
From Kartik documentation here on pjax settings
Answered By - Geoff
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.