Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

tnajdek/django-kendoui-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Django Kendo UI backend

##Description

Provides a generic view that will feed Kendo UI (http://kendoui.com) components with model data. Supports server-side pagin, filtering, sorting and grouping.

##Requirements

  • Django >=1.9.0
  • querystring_parser>=1.2.3
  • six>=1.10.0

##Installation

$ pip install django-kendoui-backend

or

$ easy_install django-kendoui-backend

or (requires you to solve dependencies first)

$ git clone git://github.com/irwebuniq/django-kendoui-backend.git
$ export PYTHONPATH=$PYTHONPATH:$(pwd)/django-kendoui-backend/

or (requires you to solve dependencies first)

$ git clone git://github.com/irwebuniq/django-kendoui-backend.git
$ cd django-kendoui-backend
$ sudo python setup.py install

Usage

  • Add to urls.py:

      from kendoui_backend.views import KendoListProviderView
      url(r'^example_model$', KendoListProviderView.as_view(model=ExampleModel), name='example_model'),
    
  • Feed your Kendo UI component with data source, e.g.:

      var ds = new kendo.data.DataSource({
          pageSize: 20,
          serverPaging: true,
          serverFiltering: true,
          serverSorting: true,
          transport: {
              read: {
                  url: "{% url example_model %}",
                  dataType: "json",
              }
          },
          schema: {
              total: "count",
              data: function(d) {return d['payload'].map(function(e) {return e['fields']})} // This bit is required for Kendo UI to navigate through data set received from the server correctly
          }
      }
    
  • Create a Kendo UI component with a DataSource created in above step:

      $("#dropdown").kendoDropDownList({
          dataTextField: "name",
          dataValueField: "number",
          dataSource: ds3,
          index: 0,
      });
    

For more details see the example app

License

This code is released under MIT License.

About

Generic data backend for Kendo UI components

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published