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

Grid server side binding and client side paging, sorting etc

13 Answers 1648 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dima
Top achievements
Rank 1
Dima asked on 25 Feb 2013, 11:10 AM
Hello,

Is there any way to bind my grid with all my data at the server side and manipulate it at the client side without making any posts(paging, sorting, etc)?

Thanks in advance,
Dzmitry

13 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 27 Feb 2013, 08:34 AM
Hello Dima,

This can be achieved by setting DataSource ServerOperation setting to false and pass the data to the Grid constructor. Please refer to this online demo for an sample code (use the tab of the code view to select the ASP.NET MVC version of the demo).

All the best,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dima
Top achievements
Rank 1
answered on 28 Feb 2013, 06:41 AM
Thanks for your fast reply. Any chance to use column.Template instead column.ClientTemplate?
Because after add this line:
.DataSource(dataSource => dataSource.Ajax()
    .ServerOperation(false)

Any code inside of Template method is ignored and code inside of ClientTemplate is used.

Thanks in advance,
Dzmitry
0
Rosen
Telerik team
answered on 01 Mar 2013, 07:46 AM
Hello Dima,

I'm afraid that when client operation mode or AJAX binding is used, the use of ClientTemplates is required.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dima
Top achievements
Rank 1
answered on 01 Mar 2013, 08:14 AM
Hi Rosen,

Can i achieve my goal to enable paging at the client side. For example, at the server i load all data that i want to be bound to my grid without enabling paging. When page is loaded, can i set additional options to grid by the js like this:

$("#grid").kendoGrid({pageSize:10, pageable:true});

Is there any chance that this kind of solution can be used? :)

In this case, i can create additional wrappers for this purpose to generate js like this to do any kind of work and to be able to use server side templates for my grid.

Thanks in advance,
Dima
0
Rosen
Telerik team
answered on 01 Mar 2013, 12:51 PM
Hi Dima,

The client templates are required in order the Grid to be rendered, when created as result of some client operation, like paging for example. Server templates will require server template and server rendering.

All the best,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Bob
Top achievements
Rank 1
answered on 08 Jan 2015, 09:49 PM
I'm having same problem of sever-side hits when I want all client-side.  In my scenario, the grid appears to re-hitting datasource when loading "filter hints" dropdown such as for a string value column after typing a character in filter box.  It does not appear to be re-hitting datasource for the actual filtering.
0
Rosen
Telerik team
answered on 09 Jan 2015, 09:52 AM
Hi Bob,

If I understood your scenario correctly, you are using filter row feature and do not want autocomplete widgets to use AJAX binding in order to retrieve the data. In this case you could use the BindTo option in order to re-populate the filtering widgets with the required information. For example:

columns.Bound(p => p.ShipName)
            .Width(500)
            .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")
                .BindTo((System.Collections.IEnumerable)ViewBag.ShipNames)));
 
//where  ViewBag.ShipNames is populated similar to the following:
ViewBag.ShipNames = GetOrders().Select(o => new { o.ShipName }).Distinct();


Regards,
Rosen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Bob
Top achievements
Rank 1
answered on 09 Jan 2015, 01:36 PM
Thanks, but I was hoping the grid had the capability to query the JSON data source that it already has pulled down to client.
0
Rosen
Telerik team
answered on 09 Jan 2015, 03:01 PM
Hi Bob,

I'm afraid that this is not possible. Although, their initial configuration might be shared (at least in most case) the filter row widgets and grid widgets uses separate DataSource instances. Which should be populated independently.

Regards,
Rosen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Bob
Top achievements
Rank 1
answered on 09 Jan 2015, 03:08 PM
Can this be logged as an enhancement request somewhere? Or configuration setting? I'm working against a rather sensitive database that I have little control over, so re-hitting the datasource when we already have the data for the filter hint/autocomplete dropdown in JSON format seems expensive.
0
Rosen
Telerik team
answered on 12 Jan 2015, 09:16 AM

Hello Bob,

You can log this as a enhancement request in our user voice portal here. When planning for a release we gather and take into account all feedback from the public portal - the most popular request take the highest priority.

Regards,
Rosen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Bob
Top achievements
Rank 1
answered on 14 Jan 2015, 03:24 PM
Hi, I've been asked to disable this autocomplete/hint feature on filters if possible.  How would I do this?
0
Rosen
Telerik team
answered on 15 Jan 2015, 10:40 AM

Hello Bob,

You could override the filter cell input element and prevent the AutoComplete widget creation by using the Template option, similar to the following: 

ftb.Cell(cell => cell.Operator("contains").Template("filterCell"))
 
<script>
    function filterCell(e) {
        e.element.addClass("k-textbox").width("100%");
    }
</script>

On a side note. As the discussion diverge far from the original topic of the thread, please open a separate support request if additional questions arise. 

 

Regards,
Rosen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Dima
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Dima
Top achievements
Rank 1
Bob
Top achievements
Rank 1
Share this question
or