How to use vue-router to show different views of a data table - vue.js

My web app shows a table of data as the primary view and one of the columns is "item-type". We also need to be able to show alternate versions of the table, limited to each item type.
For example, the main grid shows list all items in the table. But the "red" version only shows the items with the "item-type" of "red". And green shows only green, etc.
Then, in the menu, we need to show counts for how many are in each category - red (3), green (14), etc.
Our primary grid is a slightly modified version of the example from vuejs.org.
My assumption is that I need to create a new filter in the grid component to limit data by "item-type", and then use vue-router to dynamically link to each of those views. Is that the correct way to solve the problem? I can't find any documentation or examples or how to even get started.
Any help would be greatly appreciated!

Related

Razor Pages horizontal Table

Good morning,
I am developing my Web Application using .Net Core 3.1 and Razor Pages.
In my application I need to display a large amount of data on a grid and would therefor like to rotate a standard grid 90 degrees. I would like to obtain something like the "Horizontal Scroll" of this blog post but instead of just scrolling horizontally I would likle to move the headers to the side and, as mentioned above, rotate the entire grid fields.
I can't find any API that suites my needs though. Does anyone have suggestions on something I could try? I wouldn't want to have to build the entire grid myself (with all the paging, filtering and ordering logic). I am open for alternative solutions as well!!
Thanks everyone!
This seems more like an HTML question, and does not really relate to Razor Pages. Here are a couple of examples of horizontal scrolling HTML tables:
https://mdbootstrap.com/docs/jquery/tables/scroll/#datatable-horizontal-scroll
https://datatables.net/examples/basic_init/scroll_x.html
You said you need to display a large amount of data, I think the
design you currently want is not suitable for the display of a large
amount of data.
Because if the title is on the left, then only one data can be displayed on each page, and each page needs to load the title, which will lead to great redundancy.
If you just want to display beautiful because of too many columns, I suggest you use the responsive property in jQuery datatable, which can dynamically display the number of columns according to your current page width, and collapse or display the extra columns.
You can refer to this.

Change product image on variant change

I am struggling to find an ideal solution to change the product image based on the variant selection. I do not see any identifier on the product images using which I could do a cross matching for js change event.
Every theme has this feature, so I guess, there is a pretty good solution to this.
Can you please help me showing the right path?
Thank you.
It depends on the design of the page and what are using.
For example if you plan to show a single image for the variant change you can use the variant image directly.
But if you plan to use a gallery of images there are different approaches. The one I use in most cases is to set an ALT attribute to each image with the name of the color that it's pointing to. Based on those ALT attributes I use some JS logic to filter specific images and show the correct ones.
Other approaches will be to use metafields, tags, linklists etc... A lot of different ways, but each is tied to some JS logic and some bad user experience for the administration since he will be required to switch between different pages and to create different elements in order to tie them to the images.
The final way is to use a separate APP for this.

Custom odoo module - how to make a table

I am creating a custom module with additional part numbers on a separate tab in the products screen. I have built the module, but am having trouble figuring out how to display the information so it matches the layout in the attached image. I have tried tree view but have not been able to get the fields on the same line. Can this only be accomplished through css or is there a table view that I am not aware of?
I also need to make sure that all of the information in row 1 stays tethered together for additional forms, etc. My plan is to make the field names for each row end with a different number (i.e. x_mfrname1,x_mfrpn1,x_mfrname2,x_mfrpn2, etc.). Can somebody please just tell me if I am on the right track. This is the initial Odoo setup for a client of mine and I don't want them to come back to me down the line and find out I forgot something. I have been scouring the internet and reading a few books but I am not completely confident.
Here is a link to a layout of what I am talking about:
MFG Part Number Tab
Thanks!
class sub_part_details(models.Model)
_name='sub.part.detail'
primary_pn=fields.Boolean('Primary P/N')
obsolete=fields.Boolean('Obsolete')
pn=fields.Char('P/N')
desc=fields.Char('Description')
upgrade=fields.Char('Upgrade')
part_detail_id=fields.Many2one('part.details')
class part_details(models.Model)
_name='part.details'
cat=fields.Char('CAT')
sub_ass=fields.Char('Subassembly')
main_ass=fields.Char('Main Assembly')
notes=fields.Text('Notes')
sub_details_ids=fields.One2Many(''sub.part.detail','part_detail_id')
It might be helpful

SDK2: drag and drop between two grids

Using SDK2, I've got two grids that are sorted by rank, so you can re-rank by dragging and dropping in each grid.
I would also like to drag and drop between the two grids-- imagine two team backlogs and you want to take a ranked story from one team and rank it in another team's backlog.
This seems like it would be common so is there a good example of how to do this with a Rally Grid?
I'm starting to read the following:
http://docs.sencha.com/extjs/4.2.1/#!/guide/drag_and_drop
But there always seem to be a few gotcha's, and for example I'm not sure how to not break the current drag drop within the grid.
SDK 2.0rc1 is built on Ext 4.1.1a- the drag and drop functionality should be similar though. You should be able to do this in an app as long as both the grids are in the same app. This is a limitation due to the fact that apps run in an iframe in Rally and you can't drag and drop across the iframe boundary.
All you should need to do is pass enableRanking true at construction of your grid. You also will probably need to include Rank in your fetch.

Virtual TableViewer sorting causes selection problems

Our application is an RCP appliction and needs to display table of several thousands items. For this reason, we're using SWT.VIRTUAL in our TableViewer. That works pretty well except for selection.
We're having following issue :
Our TableViewer support sorting and filtering. When we use a virtual tableviewer, changing the selection does not preserve the current selected item but the row currently selected.This leads to another item being selected.
e.g: If Item 'A' present at the 5th row is selected by user and sorting is performed, then after sorting the Item at the 5th row gets selected instead of the Item 'A'.
Using a non virtual TableViewer, everything works fine.
We tried to go into debug and found out that the cache from the AbstractTableViewer.VirtualManager class seems to be up to date with the model.
Forcing the cache to be used in the AbstractTableViewer.virtualSetSelectionToWidget() can be a possible approach.
We have tried to implement a solution suggested in https://bugs.eclipse.org/bugs/show_bug.cgi?id=338696. However it didn't work.
Please suggest some pointers or alternative work around.
Thanks for the answers.
As a workaround for working with huge tables I would suggest you to take a look at the Nattable project http://www.eclipse.org/nattable/. It supports everything you need (sorting, filtering, tree structured elements, lazy loading etc.). We successfully use it in our project, where it is necessary to display hundreds of thousands elements as a tree with around 160 columns. It also has some pretty cool styling features, which can make your table more user-friendly and interactive. Hope this helps