New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Populate Data In Grid Without Database #3941
Comments
I think there are some samples about populating grids from SP, or else, maybe check that? |
I want that data to be populate from string not from Stored Procedure |
I think that is because slickgrid does not know what is your Id name For example: export class GridStaticDataGrid extends Serenity.EntityGrid<**What to Populate**, any> {
protected getColumnsKey() { return 'MasterData.GridStaticData'; }
protected getIdProperty() { return "Id"; } // <================== add this line
constructor(container: JQuery) {
super(container);
var data = [];
// ...
// ... |
or change Id name of your data to data[i] = {
id: Math.round(Math.random() * 100),
}; |
What to Populate ......I dont Have StaticDataGridRow.cs so what to pass there |
LOL, they are your code, I just copied it, where did you get them ? Normally, you will need to create your own Row.cs class and Column.cs class, then generate it by transforming t4 template, after that:
|
well u dont need SP, but I thought, if u check the sample, u will learn how to pass data (from SP in sample/but in your case from string) to SlickGrid. another option is to check github for Slick Grid I am importing data from various sources (files, but string in the end), create entity instances and assign them to InMemory grid in Master/Detail scenario. so I know it's possible, to stick anything into grid. (in my case I have DB entity to serve as intermediary, but quite likely you can fake you own enTITY? |
Adding *Row.cs and Transforming to T4 Template , *Row.ts file gets created after that removed , in |
Thanks @ga5tan & @minhhungit One more doubt @Serenity.Decorators.filterable() is not working in my case. When I click on edit filter to add criteria then grid is not getting filtered with the added crteria |
About @filterable() it will not work, you must implement it by manual. |
How Can I Populate static data in grid ? I have created GridStaticDataColumn.cs / GridStaticDataGrid.ts / GridStaticDataIndex.cshtml and GridStaticDataPage.cs File. Below is my code for GridStaticDataGrid.ts, what to populate in Serenity.EntityGrid<> and I am getting Error after running as
each data element must implement a unique 'id' property
The text was updated successfully, but these errors were encountered: