Exporting all data from table using laravel backpack - laravel

I want to export all data from the products table which has more than 10k products in it. I'm using the backpack in this project and while clicking export csv only the current page will be exported. Any solution for this?
Thank you in advance :)

The export functionality is currently handled by the JS Datatable. So I'm not sure if an export with over 10k entries would work. This could be the reason why just the current page will get exported.
But I've found a little workaround. The following is stated in the Laravel Backpack docs (Link) about export:
Please note that when clicked, each button will export the currently visible table. You can use
the "visibility" button, and the "Items per page" dropdown to manipulate what is inside the export.
So try to change the amount of items in your table by using the Visibility option in the dropdown or the Items per page selection under the table to export more than just one page.
I hope this will work for now and someone else can find a solution to export everything.

Related

How to export all rows using Export Buttons of Backpack Laravel?

I'm looking to export all rows of users table using the export button of Backpack in Laravel. Currently the export button only exports the lignes of 10 rows showed, and i need to choose show all if i want to export all of the rows. How can i achieve that?
There's no easy way to do that using the existing export functionality. Backpack uses DataTables' export, which is JS-based, so limited to the rows visible on the page.
You can, however, create a custom Backpack operation, that will export all rows in the format you want using PHP, and show a button on the table view. You'd have to code your own PHP logic for it, though.
edit this file
/var/www/html/omw/vendor/backpack/crud/src/resources/views/crud/inc/export_buttons.blade.php
just copy code on line no-12 to 99 and past on line no-12
and change this
return $(node).attr('data-visible-in-table') == 'false' && $(node).attr('data-can-be-visible-in-table') == 'true';
to
return true;

Laravel Backpack Update Datatable via ajax when select field change

i am new to laravel backpack. I have a view where i have to show some details of a category, i have a dropdown list of categories on top and datatable below it listing all the details i want to update this data table when any category is selected and I want it use ajax so that it wont load the page again. I was unable to get any clue in the documents. Can someone point me to the correct way to implement this. Thank you in advance!
In Laravel backpack v4 as far I know you can use the variable crud and by calling this crud.table.draw()
You can see the file in datatables_logic.blade.php.
JQuery(document).ready(function($){
crud.table = $("#crudTable").DataTable(crud.dataTableConfiguration);
...
)}

Grafana Table Panel 'clickable' and use it to drill down to a more detailed view

Is it possible to have a Table Panel in Grafana, and when you click on a row, it shows a graph from another set of time series?
I see there is a feature request for it, but I'm not sure it's available yet
https://github.com/grafana/grafana/issues/5481
Looking for any suggestions on making the rows in a Table Panel
'clickable' and use it to drill down to a more detailed view (another
dashboard using Template variables). Currently displaying a summary of
several servers as rows in a Table Panel and we want to select an
individual row (i.e a server) to drill down to a more detailed
Dashboard.
Any ways to do this?
Thanks
You can achieve this also in 4.x by defining a link for a table column (in the Column Styles section under Visualization). The link can refer to another dashboard and embed current cell's value (or other cell in the same row) as a parameter.
For example the link Url can be:
/d/c9xaXx5Zz/tree-node?var-datasource=$datasource&var-interval_id=${__cell_1}&from=$__from&to=$__to&var-path=root
In Grafana 6 or above you can preserve the time range filter using the $__from and $__to built-in vars.
The available built-in variables to access cell contents are not well documented, but they can be found by hovering over the (i) icon of the Url in the table panel.
More info on built-in vars: https://grafana.com/docs/reference/templating/#global-built-in-variables
The feature request you linked to is a duplicate of this one which links to this Pull Request. The PR was recently merged so it is available now as a nightly build and will be included in the upcoming 5.0.0 release in September/October.
Drill Down Option can be used from General option from Grafana Dashboard.
Copy the link in the Url of the table which you want to show. Change the items in the variable part which is changing according to the need.It will be of format var-name=value
The link URL works well if you are linking to another dashboard, but it does not work well if you are changing a variable on the same dashboard as it does not auto-refresh.
You can add JavaScript into the URL instead of a link.
javascript:$('a.variable-value-link').trigger('click'); $('span:contains(${__cell:raw})').closest('a').trigger('click');
The JavaScript only works for a single dropdown, it would have to be updated if there were multiple dropdowns. I worked on this quickly, so I am sure there is a better way to use JavaScript to change the variable. It basically opens the dropdown, finds the value from the current row and selects it.

Kendo UI Grid Export to excel with extra info in the file?

I have an application which uses Kendo UI grid. The excel export features works fine. Now, I added some extra controls on the page. User can select some values, and then click 'refresh' button to update the data source of the grid. So that the grid won't load too much data all in once.
The question is: the export will export whatever on the screen (including all pages). When user opens the excel file, he/she won't know what parameters used to generate this.
For example, on the page, it has a date control, use select 1/1/2015, click refresh, grid shows all data for that date. When export, how the user know this selected date? It is not in the columns in grid.
What I want to have is an extra row at the top, which shows something like:
Date: 1/1/2015, Para2: value2, ...
Is this possible in current Kendo ui grid? or have to manipulate the excel file (which we want to avoid at any cost)?
Thanks
we can use mult-column feature of latest kendo to add one more row at the top and covers all existing columns, and use it for extra information.
http://demos.telerik.com/kendo-ui/grid/multicolumnheaders
However, I need to dynamically change the title of this row, i.e. when user select a parameter from drop down list, I need to reflect the change in the title. This can be done by jQuery. The problem is Export of Kendo. The export seems using whatever the initial title is. i.e. if I change parameters to:
Date: 2/1/2015, Para2: value2, ...
jQuery changed the title in this multi-column row. But the export still has:
Date: 1/1/2015, Para2: value2, ...
Anyone knows how to fix this? Or, can't be done in current Kendo?
Thanks

CakePHP display updated table of data using ajax

I'm having real trouble finding any documentation on this.
I have a page that displays a list of users, above this i can edit the users successfuly with ajax. After the update, i want the table below to be updated with the new information.
How do i go about doing this? I'm thinking i need some sort of view that displays the data in a table, and i want to get that view's contents and inject it into my page, but i can't seem to find out how?
Can anyone point me in the right direction please
Put users table in div id like "Users" and do something like following in edit ajax success function call
$("#users").load("same_page_url #users");

Resources