Kendo Grid with Angular 2+ Save column Order - kendo-grid

I am using kendo-grid in Angular 2+. I want to maintain user column re-ordering for future use. Means, if user change column sequence using drag and drop. He will get Column sequence in same way like last time.
To achieve this, I have to save column Index when user drag and drop Column. And, also to load grid in same sequence like last time.
Any Demo or suggestion would be appreciable.

You can check out the following how-to from the docs:
DOCS
Note that you will need to run the demos in a separate window from the Plunkers so that you have access to localStorage:

Related

How to create a custom reuseable HTML template populated with data from database?

I have a database containing many records - let's say its a people database and the columns contain Name, Surname, Age, FreeText.
I want that this data to be displayed in a list on my website. Each item in the list should contain the database' row data.
In detail, each list item should be a custom HTML div consisting e.g. of 2 columns, where in the first column the Surname and the Name should be displayed in the first row, the age in the second. In the second column there should be the free text.
There should also be a onClick listener on this item.
I am a Wordpress Beginner, I have no idea how to achieve this. I think the general approach has to be: Get records from DB, create the items dynamically, put the into the list, and display the list on the page.
I purchased the Avada theme for the design, but this kind of functionality does not seem to be included.
Any hints where to start? Do I have to create dynamic php files, and if yes, how? With javascript? Or are there Plugins available which I can use?
i find this plugin for you try this link:
https://wordpress.org/plugins/participants-database/
This plugin offers all the functionality needed to build and maintain a database of people or anything you want. The database is fully configurable, allowing you to define all the fields of information you want to store for each record. The records can be entered individually in the WordPress admin section, imported with a CSV file, or let the individuals themselves create their own record. Display lists of records can be sorted and filtered by any field, and the result exported as a CSV file.

Add dynamic number of columns in grid according to query in BIRT

i have a query which designs dynamic number of columns from a table having data.
now i need to add grid with dynamic number of columns according to query.
select fruit,count(*) from mytable group by fruit;
i am getting how to add it manually but at runtime i may be having different number of columns. so what procedure i need to do for adding columns to grid dynamically in BIRT report
You can extend or modify your report template at runtime in, for instance, a custom EventHandler for the Report.beforeFactory() event. The handler can be implemented either in Java or in JavaScript. BIRT has Design Engine API. There is a plug-in, that could be helpful. Even if you cannot use it as it is, it provides examples of how to use BIRT Design Engine API. Using Design Enigine API you can also create new template from scratch at runtime.
Alternatively you can use Crosstab and have fruits as a Dimension and COUNT(*) as a Measure. It will add a column for each fruit, but it might be an overkill for your example.

Create gridview that adds in data (number of records) dynamically

I need something to hold the search results and I'm thinking of using gridview (or maybe a table). When user performed a search, search results will be shown in a table format. Something like:
The column attributes are fixed. But the number of records returned may be different and the gridview (or table) must be expanded accordingly. The max records at one page will be 10 and I need to do Paging at the bottom as well.
In this gridview (or table), user can click on the ID to select the result for other purposes. I have to cater that requirement too.
I'm using MVC with html and css. Please help! I am really new to this!
You may take a look at the WebGrid helper: http://msdn.microsoft.com/en-us/magazine/hh288075.aspx

Matrix of boolean values in an Access form

I am designing a form at work where I need to be able to set "Properties" for a large number of (accounting) "structures". I have a "Value" field where the user enters the value that property must take and then I have 1 column for every structure where the user must be able to check / uncheck each property for each structure. Also, I need to be able to suggest checkbox values (aka mapping of properties to structures) to the user so that he/she doesn't have to manually click all the checkboxes that will always need to be ticked. Finally, the number of properties (rows) and the number of structures (columns) should not be assumed to be fixed though I don't want the user to be able to modify it himself. I just want it so that a dev (probably me) doesn't have a hard time adding or removing structures.
For now I have used a local table where each structure is a column and I have hardcoded my properties (which is good). However, I am not sure that using a local table is good design. We normally avoid having forms and tables in the same Access DB to separate forms and data. Also, I'm wondering if there is an elegant solution that I am missing. There will be at least 10-15 structures and 11 properties, that would make 110 (11*10) checkboxes to handle so I cannot do it manually (i.e. create 110 checkboxes and check 110 values everytime...).
Here you can see what that part of the form looks like for now.
I know this will be a chattier question but I really need a design check on this so here are a few questions that I try to make as general and objective as possible:
In Access, how is it possible to create a matrix of controls where 1 column contains a fixed (but changeable by a dev) number of properties, a "value" field that can take text and then 10+ columns with Yes/No values ?
Is it possible to do it without a local table ?
VBA is perfectly admissible.
Thanks.
In Access, how is it possible to create a matrix of controls where 1 column contains a fixed (but changeable by a dev) number of properties, a "value" field that can take text and then 10+ columns with Yes/No values ?
I've never seen any VBA code that does what you describe. VB6 allowed the creation of "control arrays" to logically group controls (and work around some limitations on the number of controls on a form), but I've never seen that mentioned for VBA.
Is it possible to do it without a local table?
Is it possible? Maybe, since you can modify a form via code by opening it in Design View and using CreateControl() to add controls.
Is it practical? Probably not, because the "Access Specifications" section of Access Help mentions the following limit...
"Number of controls and sections that you can add over the lifetime of the form or report: 754"
..so it sounds like code that repeatedly modifies a form could very well break after a while.
My recommendation would be to create a temporary table, use it, and then discard it. If you're worried about front-end bloat then you could create the temporary table in a temporary .accdb file and then link to it.
Maybe I'm missing something, but it seems pretty easy to me.
Make each structure a record.
Then in another table, make each property a record with a 1-many relationship with the structure table. So, each structure will have many properties.
Then a form based on the structure with a sub-form based on it's properties.
Default property values can be set in the table structure.
And of course the tables can be linked from another DB.
In Access, how is it possible to create a matrix of controls where 1 column contains a fixed (but changeable by a dev) number of properties, a "value" field that can take text and then 10+ columns with Yes/No values?
I'm still not certain why you want multiple bits/booleans in a single column, but you might be able to utilize bit logic and long integer column. VBA does something like this with its constants. For instance, in a MsgBox, you make your type = vbCritical + vbYesNo. Its result is in an integer value that VBA interprets to make a Critcal MsgBox with only a Yes and a No button. The reason this works is because the value of each constant is so distinct that any summation with like constants results in a unique value that can be de-parsed. It's fairly elegant from a user perspective, but I'd hate to do the math on the back-end to make such a function work.
It might be better to maintain a separate table of available properties and/or property sets and build / maintain your property sheet that way. You could assign property sets as well as individual properties to particular controls. You could also specify in either table whether there is a default value for that property and/or what that value is.
It is also likely that you do not need that many bits. I'd be happy to narrow my answer to your situation if you could update your question with more detail regarding the nature of your bit need(s).
Is it possible to do it without a local table?
You might be able to create a DAO.Recordset dynamically in Access.
It might be better to adjust your properties table(s) (see above) to be a permanent table in one of your databases rather than re-populating the same data every time.
You could take more of a master/detail approach, combining your bit fields into a string description describing the boxes which are checked.
For example, if you have a structure named 'structure1', value 100, and 5 condition bits set, you could have one string column with text 'cond1, cond2, cond7, cond8, cond9' and then another button allowing them to modify that set of conditions for that single structure.
You'd have fewer checkboxes, anyways.
The only thing I can think of equivalent to 'a matrix of controls where 1 column contains a fixed (but changeable by a dev) number of properties' is an editable query result set.
You'll need a table for your structure -> default conditions set, if nothing else, but it doesn't have to be in the same db as the front end.
HTH

Save and get arbitrary sort order in SQL Server

My client wants to sort products by drag & drop. The drag & drop part is easy with javascript.
My problem is how do I save and get the sort order?
I'm using .net c# and SQL Server 2008.
When I move a product and drop it in a new position I get the id of the product that's moved, product in front and product behind. With this data I want to update the sort order of products.
I was thinking of adding a field with position, but then I guess I have to update every item when position changes.
In general adding an additional position field is the only thing you can do, to get truly arbitrary ordering.
But you can implement it in several ways. Here are two ways I've implemented myself some time ago.
1. Method: Update all position values, by looping over your items and performing an UPDATE statement for every position.
This is easy to implement, but because of the many updates, it's not good for many items and/or large tables. Especially if you do it via Ajax and perform a complete re-ordering on every change in the list.
2. Method: Do a smart update of only the affected rows.
SELECT all items in the current sort order (The "old list") (Usually fast compared to an UPDATE statement)
Iterate over all items from the "new list" and compare each item to the item from the old list at the same position/index. If the items are the same, don't do anything
If the items are different find that item from the old list, which should actually be at that position and update its position value accordingly (Some lookup data structure might be useful here)
That way you only have to perform minimal database updates, but you'll have more complex code.
Personally I'd go with the first way, until the database updates actually become a performance problem.
We have a sort column but yes we have to re-index all rows as things change. You could mitigate this by assigning sort's in large enough increments to allow some level of movability before you have to do this, such as in 10's or 100's but that's not the best solution and I'd be interested to see what other ideas people have.
If you can capture each move programatically (with up and down buttons for example) then you can just swap the position numbers of the row moving and the row being moved. Make sure that you add new rows at the max position + 1.