Resolve "Job order table auto-refresh" #819

Merged
arcticzero merged 2 commits from 6-job-order-table-auto-refresh into master 2018-02-17 08:51:04 +00:00
5 changed files with 16 additions and 3 deletions

View file

@ -6,6 +6,7 @@ parameters:
latitude: 14.6091 latitude: 14.6091
longitude: 121.0223 longitude: 121.0223
image_upload_directory: '%kernel.project_dir%/public/uploads' image_upload_directory: '%kernel.project_dir%/public/uploads'
job_order_refresh_interval: 300000
services: services:
# default configuration for services in *this* file # default configuration for services in *this* file

View file

@ -214,6 +214,8 @@ class JobOrderController extends BaseController
{ {
$params = $this->initParameters('jo_assign'); $params = $this->initParameters('jo_assign');
$params['table_refresh_rate'] = $this->container->getParameter('job_order_refresh_interval');
return $this->render('job-order/list.assigning.html.twig', $params); return $this->render('job-order/list.assigning.html.twig', $params);
} }
@ -226,6 +228,7 @@ class JobOrderController extends BaseController
$params['tier_name'] = $tier_params['name']; $params['tier_name'] = $tier_params['name'];
$params['rows_route'] = $tier_params['rows_route']; $params['rows_route'] = $tier_params['rows_route'];
$params['table_refresh_rate'] = $this->container->getParameter('job_order_refresh_interval');
// response // response
return $this->render('job-order/list.html.twig', $params); return $this->render('job-order/list.html.twig', $params);

View file

@ -123,7 +123,10 @@
var table = $("#data-rows").mDatatable(options); var table = $("#data-rows").mDatatable(options);
// auto refresh table
setInterval(function() {
table.reload();
}, {{ table_refresh_rate }});
}); });
</script> </script>
{% endblock %} {% endblock %}

View file

@ -119,7 +119,10 @@
var table = $("#data-rows").mDatatable(options); var table = $("#data-rows").mDatatable(options);
// auto refresh table
setInterval(function() {
table.reload();
}, {{ table_refresh_rate }});
}); });
</script> </script>
{% endblock %} {% endblock %}

View file

@ -119,7 +119,10 @@
var table = $("#data-rows").mDatatable(options); var table = $("#data-rows").mDatatable(options);
// auto refresh table
setInterval(function() {
table.reload();
}, {{ table_refresh_rate }});
}); });
</script> </script>
{% endblock %} {% endblock %}