This is a migrated thread and some comments may be shown as answers.

Filtering a bootstrap table

3 Answers 260 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mirjam
Top achievements
Rank 1
Mirjam asked on 14 Oct 2016, 02:38 PM

Hi guys,

I have a few problems with my brandnew grid. The situation is this: I added a grid to an mvc view. I made the grid columns filterable with the filterable: true setting.
The grid also contains a column with a checkbox to enable multiselect and a submit button to process the selection. If I tick a few boxes and process the selection everything works fine. If I use the filter and then select multiple rows to process, the list returned to the controller contains the wrong number of records or no records at all.

Furthermore, only rhe 'contains' option in the filter produces results, if I choose another option I get a grid with no results. I put the code for the View, ViewModel, Controller, the _layout.cshtml and the bundle.config in the attached zip. I'm afraid I couldn't get it in to a working project, because of the necessary data. I hope you'll still be able to figure out what's going wrong.

Cheers,

Mirjam

 

3 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 18 Oct 2016, 11:10 AM
Hello Mirjam,

The grid in the Index.cshtml View does not contain any columns and I can see how it is populated. There is no data provided for the data source. Is this the code that we should reference? Here you can find a sample of a grid that has enabled filtering.

Regards,
Angel Petrov
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mirjam
Top achievements
Rank 1
answered on 18 Oct 2016, 12:47 PM

Hi Angel,

The grid is populated using the mvc structure. In the Alerts controller, the service layer for alerts is called and this gets the relevant data from the database. What I guess I am trying to figure out is whether it is possible to use the filteroptions from the grid, without completely rebuilding the page. As in, putting a layer of grid functionality on top of the existing mvc table. But it looks like that is going to be difficult...

Kind regards,

Mirjam

 

0
Angel Petrov
Telerik team
answered on 20 Oct 2016, 10:24 AM
Hello Mirjam,

I am experiencing difficulties understanding the exact requirement. If you want to configure the grid to read the data from a controller action you can initialize it as demonstrated here. In this case however you do not need to initialize it from a table.

Regards,
Angel Petrov
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Tags
Grid
Asked by
Mirjam
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Mirjam
Top achievements
Rank 1
Share this question
or