I have a grid with many columns, and a popup dialogue for adding new records.
I have set deafultValues on data models fields array works fine, now I am trying to reuse that and add this defaults values dynamically from the server.
I have entityName/def available in the server that have the feilds name with default values in it.
I have so many entities,
so proxy transform function would be best ? or when creating the the dialogue form window, call the the server to populate the fields ?
I am new to ExtJS and Sencha and I don't have a clear way to both mentioned ways. I am buzzled!!
Any answers, hints are truly appreciated.
Related
On a Vaadin application, I instanciate a same combobox on each tab.
These combobox contains a large information list. That takes huge memory on the server.
I have three tabs, therefore, the combobox appears three times.
I wish create one combobox on my application with a pattern singleton.
And this one combobox will be shared by three tabs.
But if I apply this pattern singleton, the combobox appears at once on only one tab.
How can create a singleton combobox and this last appears on each tab ?
Thanks by advance.
Vaadin component can be attached to one UI only, and one layout at the time. Thus Vaadin component cannot be singleton.
However, you have number other options to solve your actual problem.
The first and the most obvious thing is that you can use data provider from callbacks in your ComboBox. If the information list is large, this is the first thing you should do. When you use data provider from callbacks, only small buffer of items is kept in memory and as user scrolls the ComboBox.
DataProvider<Bean, Void> dataProvider =
DataProvider.fromCallbacks(
query -> {
List<Bean> beans = getBeansService()
.fetchBeans(query.getOffset(), query.getLimit());
return beans.stream();
},
query -> getBeansService().getBeansCount());
);
ComboBox<Bean> combo = new ComboBox<>();
combo.setDataProvider(dataProvider);
When you setup the ComboBox like this, you can easily have multiple instance of the ComboBox.
In case you still use in memory data provider, you can actually share it with multiple component instances.
ListDataProvider<Bean> dataProvider = DataProvider.ofCollection(items);
comboBox1.setDataProvider(dataProvider);
comboBox2.setDataProvider(dataProvider);
I'm new on reactjs, and I want to create a table to show some data. In the project I'm working, we are using Ag-Grid datagrid.
I already have created it with basic usage, but my question is:
Supose I have 100 rows as enter, how I can display in datagrid just the 10 firsts?
I stil wanna load all data (for filtering, sort, etc), just don't wanna show all by default.
I'm looking at documentation and do some search, but don't find the proper way to do it.
Edit: I already see the pagination options (the default solution provided by documentation), but in my case, at least for now I don't want pagination. Just wanna render the X first rows (the extra will be ommited in table, but have to be loaded in UI, if not, I could use autoHeight).
Thanks in advance.
I'm assuming you are using the Client Side Row Model and not loading data from a Server. In which case, the easiest way to achieve this would be to show the 10 rows, and add more rows (depending on when you want to load them) via Transaction Updates, please see the documentation on this here
you can use pagination:
documentation reference
I have to create a table with different type of fields like text box , drop-down , toggle button etc.
For eg below fields for 20 rows
Name - textbox
Gender - dropdown
I was thinking of creating a redux form and embed it into a table and repeat it for each rows. Also want to bind data per row.
But not sure how to progress with it. Please help and suggest any other way. Due to certain restriction I could not use available components..so I have to create my own component
I would like to use one of the many table/data-grid components available to render a table. However, I am struggling to choose one as I have very specific requirements and I'm not sure if they are supported by them.
Ok so ideally I would like the table to initialise with only column headers (which are populated by data from a database). I would then like to be able to add a row (by clicking on a button), and be able to enter data into the cells and then save the data in that row to my database. The column headers are generated by form but there can feasibly be any number of them. Most of the examples for the various components seem to expect you to already know what your data is before you render the table. But this will not be the case for me.
I was considering Griddle but they don't have an editable cell option yet (it's only part of the roadmap) so unless I create my own custom function, I think that that is out for now.
I was just hoping for some guidance is choosing the best component for what I need!
Thanks for your time
I have following requirement.
Display data in a table
Clicking on checkbox filter out currently displayed rows by some condition
Clicking on checkbox once again return data appearance to it's previous state
To achieve this I've ovverided method rowQualifies in my ViewObject which is simple SQL based view object to apply my custom filter logic.
When user clicks on checkbox I refresh view object data to apply filter
viewObject.setDoFiltering(true);
viewObject.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
viewObject.executeQuery();
It works perfectly, data set updates without interacting with database and my custom filter logic applies as well.
But when I need to cancel filter it wouldn't work because iterator doesn't contain anymore previous rows, and I can only load them from database but it means that I can lose my changes already made to view object rows.
So, when I do
viewObject.setDoFiltering(false);
viewObject.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
viewObject.executeQuery();
It will return me those rows that were displayed previous time.
If I do
viewObject.setDoFiltering(true);
viewObject.setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES);
viewObject.executeQuery();
It will return me all rows, but I will lost my changes already made to view object rows.
My questions is how to avoid it? Maybe there is another way of doing this? Maybe it is possible to do something with RichTable to tell it how to filter rows in memory.
Any advices are warmly appricated!
I believe this can be done using ViewCriteria, to filter means to apply a ViewCriteria, and then disable it to view all your data