Does anyone know the Yet Another DataTables Column Filter (yadcf) js plugin ?
It doesn't have much documentation and I can't figure out how to set the default number of rows to display (it shows 10 rows as default and I want at least 50).
Quick answer: "pageLength": 50 (for 1.10+) or "iDisplayLength": 50 (for 1.9-)
Long one:
You need to distinguish between the datatables plugin and yadcf plugin
The sole purpose of yadcf it to allow the user the ability to easily add various types of filters to the datatables table
This jQuery plug-in allows the user to easily add filter components to table columns, the plug-in works on top of the DataTables jQuery plug-in.
So your current question is not related to the yadcf plugin,
But if you look at the yadcf showcase you can spot that in on of its pages it demonstrate the use of the iDisplayLength attribute (which is the one you need your case)
Look at the page Yet Another DataTables Column Filter - DOM source example, scroll till you see the code snippet used on that page , notice the: "iDisplayLength": 25
p.s I'm the author of yadcf
Related
I'm using the VueJS Vuetify framework and I need a pagination option with more features then the basic one available.
what am i looking for:
an option to add custom names (not just numbers)
a tooltip over the buttons
to disable/enable just some of the buttons
pagination - meaning: use next, previous and "..." if there are too many pages
if the pagination had a template option (slot) that would of been perfect.
now i am wondering how is the best why to get my goal. is there a way to add templates to vuetify? is there a different component that has this options on the pagination?
Read the api here In answer to your questions:
1+2+3 This is not supported in vuetify out of the box and therefore you may want to consider writing your own pagination tool or looking for a different package.
4. This can be set in the props as described in the docs above, see total-visible prop and length.
My problem is the next:
I have a table in which I store information, by clicking on a row there will be a window in which I show that information in a certain format.
The problem I have when I try to make the table responsive because when trying to see it on small devices I have to do side scroll. I tried to hide columns with "display: hidden" but the data I can not retrieve, beacuse it not exists.
How can i do this?
Do yourself a favor - do not reinvent the wheel and use a specialized library, for example Datatables. At the very least, take a look at how datatables makes the table responsive.
You have not mentioned it, so I assume you are ok using jQuery, Bootstrap 3 or 4, Semantic UI or Foundation. For React / Angular there maybe other options.
Can anyone point me to an example of using the Pagination extension of dgrid with a dgrid? This could be a reference link or a simple example you type up. I've defined it in my code, used it with an OnDemandGrid where it is added to the declare mixin for my custom grid. I see arrows for page navigation, I see the page size setting menu, but my specification of rowsPerPage: 3 does nothing. I still see my 7 sample records.
I'm using a modified Cache (data object store) that wraps a JsonRest and Memory store for my dgrid.
I think the issue is that you can't use OnDemandGrid with pagination since the OnDemandGrid has it's own internal virtual paging logic. From the dgrid extensions wiki:
In contrast to the OnDemandList and OnDemandGrid modules, the
Pagination extension implements classic discrete paging controls. It
displays a certain number of results at a given time, and provides a
footer area with controls to switch between pages.
Note: the Pagination extension should be mixed into List or Grid, not
one of the OnDemand constructors, since those contain their own
virtual scrolling logic. Internally, Pagination inherits from the same
_StoreMixin module inherited by the OnDemand prototypes for common integration with dojo/store.
What you want to do instead is mixin Pagination into a plain Grid. The Pagination Mixin includes the properties you're interested in such as number of rows. The Paginator extension handles talking to the provided store for retrieving and rendering the set of rows to display. A define for a class like that might look like:
define(['dojo/_base/declare','dgrid/Grid', 'dgrid/extensions/Pagination'],function(declare,Grid,Pagination){
return declare('mine.PaginatedGrid',[Grid,Pagination],{
//various default you can set
pagingLinks: false,
pagingTextBox: true,
firstLastArrows: true,
minRowsPerPage: 5,
rowsPerPage: 5,
pageSizeOptions: [5, 10, 15, 25, 50, 100]
});
});
The best examples of DGrid and its extensions can be found in the test folder of the DGrid project. They can be found here:
DGrid Tests
Specifically the Paginations Tests can be found:
Here,
here,
and here
To run them:
Clone the git repo
Drop it on your webserver
Navigate to the html page
I am using Dojo enhancedGrid (1.6) with indirectSelection plugin to generate checkboxes. I am having an issue with row selection and sorting.
Here is how to recreate the problem:
Check the checkboxes of the first 2 rows
Sort the grid by clicking on a column
The sort order of the rows changes, but the first 2 rows are still checked, the checkmark doesn't move with the rows.
This issue is present in both dataGrid and enhancedGrid, even on the Dojo example page.
http://dojotoolkit.org/reference-guide/dojox/grid/DataGrid.html
http://dojotoolkit.org/reference-guide/dojox/grid/EnhancedGrid.html
Is this a bug or is there a way to make the checkbox move with the row when sorting?
Yes,it really is.
I'm using dojo 1.7.1 release , and it still has this problem
what's more , when use
grid.rowSelectCell.setDisabled(0, true),
and then use
dijit.byId("dataGrid").rowSelectCell.toggleAllSelection(true);
the disabled checkboxes will still be selected.
badly, use
gridDomNode.selection.getSelected();
will still select the rows with disabled checkboxes
Hope this still helps.
I had the same issue, and found out it is already solved and patched... (at least from dojo version 1.6)
In short, the only thig you need to do is this.
[in your EnhancedGrid] set 'keepSelection' attribute to true,
e.g.
<div dojoType="dojox.grid.EnhancedGrid" keepSelection = true .../>
also, note that there is a precondition: Identifier(id) is required for store, as id is used for differentiating row items
thats it! now any sorting, filtering or pagination actions in the grid will preserve the selections!
More info here:
http://bugs.dojotoolkit.org/ticket/10855
Note: I'm using dojo version 1.6 and the patch mentioned in there is ALREADY applied to the dojo files, so you DO NOT NEED to apply such patch, just add the attribute to the grid, (and ensure your store is identified by the id.)
In asp.net the DataGrid supports templates. You can provide your own template and have the grid fill the data in your template.
With Dojo Grid, it seems like I can't make my own template outside of the the rigid simplistic cell style grid that Dojo provides.
Does anyone know a way to use a custom template with Dojo Grid? Specifically, with Dojo you're forced to use a cell that corresponds to a data item. I'm looking to use a table as a template with any styling that I choose (rows,columns,rowspans,colspans, more than one data items in a single cell, etc).
Any clues please?
Thanks
Firstly, it sounds like everything you want is available by customizing the grid. You can do nesting of cells and even have things like Filtering Selects in rows. Unfortunately the docs on this are not awesome so it takes Googling and trial and error if you want very customized features.
Secondly, because of the OO nature of Dojo you can always use inheritance to create mixes of various widgets. Specifically the _templated class allows you to specify an HTML template for your widget, which themselves can included templated widgets.
If that sounds non-trivial, you're right, which is why I would suggest digging deeper into the Enhanced grid and probably open up the code before trying to write something yourself.
I can tell you that I struggled getting it working correctly, but I have hence been pleasantly surprised by features that I needed that I thought I would need to build myself but were built into the grid.