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

serverPaging, serverSorting and serverFiltering questions

5 Answers 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JOHNY
Top achievements
Rank 1
JOHNY asked on 06 Nov 2013, 05:28 PM


Question 1
Is serverPaging, serverSorting and serverFiltering officially supported with javascript notation?
 

Question 2

To enable serverPaging, serverSorting and serverFiltering through javascript the dataSource schema must be changed to:

  schema: {                   
data: "data",                   
total: "total"               
}

Here
is our previous schema which enabled us to define default values and specify types, how do we combine the two:
               
schema: {                   
model: {                       
id: "TransactionID",                       
fields: {                           
TransactionID: { editable: false, nullable: true, defaultValue : "00000000-0000-0000-0000-000000000000"
},                           
TicketNumber: {type: "string" },                           
//TransactionTypeDesc: { type: "string",editable: false,
defaultValue: "Fuel" },                           
StatusName: {type: "string" },                           
Departure_Date: { type: "date"},                           
Arrival_Date: {type: "date"},                           
FlightNumber: { type: "string" },                           
AircraftName: {type: "string" },                           
TerminalAndGate: { type: "string" },                           
AirlineName: {type: "string", defaultValue: { AirlineID: 1,
AirlineName: "135 Airways"} },                            
DestinationAirportCode: { type: "string", defaultValue: { LocationID:1, AirportCode: "ATL"} },                          
ArrivalAirportCode: { type: "string", defaultValue: { LocationID: 1, AirportCode: "ATL"} },                            
ShipNumber: { type: "string" },                           
TailNumber: { type: "string" },                           
Product: { type: "string" },                           
FuelQuantity: { type: "string" },
Temperature: { type: "string" },
Density: { type: "string" },                           
StartTotalizer: { type: "string" },
StopTotalizer: { type: "string" },
TotalGallons: { type: "string" },
FuelEquipment: { type: "string" },
Fueler: { type: "string" },
InOpGuage: { type: "string" },
Supplier: { type: "string" },
StartTime: { type: "string" },
EndTime: { type: "string" },
FuelCaps: { type: "string" },
Notes: { type: "string" }
}                
}           
}

5 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 08 Nov 2013, 12:56 PM
Hi Johny,

 
Please find the answers of your questions below:

1) You can check the dataSource API documentation for examples of using these properties. 

2) This change is not required, however if you are ToDataSourceResult extension method you should include that configuration.

var dataSource = new kendo.data.DataSource({
        transport: {
            /* transport configuration */
        },
        serverPaging: true,
        serverSorting: true,
        schema: {
            data: "Data",
            total: "Total"
        }
Kind Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
JOHNY
Top achievements
Rank 1
answered on 08 Nov 2013, 11:25 PM
We are using ToDataSourceResult extension method. How do we define our schema for formatting control in this case?

0
Vladimir Iliev
Telerik team
answered on 12 Nov 2013, 08:40 AM
Hi Johny,


I'm not sure that I understand your last question - could you please provide more information about what exactly do you mean with "formatting control in this case"?

Kind Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
JOHNY
Top achievements
Rank 1
answered on 14 Nov 2013, 11:33 PM

We are asking how do we define our model and allow for dropdowns etc (i.e. AirlineName: {type: "string", defaultValue: { AirlineID: 1, AirlineName: "135 Airways"} }, ) in the case where we are using serverPaging. Please see the original question below. 

Original Question 2

To enable serverPaging, serverSorting and serverFiltering through javascript the dataSource schema must be changed to: 

  schema: {
                    data: "data",
                    total: "total"
                }

 Here is our previous schema which enabled us to define default values and specify types, how do we combine the two:


               
schema: {
                    model: {
                        id: "TransactionID",
                        fields: {
                            TransactionID: { editable: false, nullable: true, defaultValue : "00000000-0000-0000-0000-000000000000" },
                            TicketNumber: {type: "string" },
                            //TransactionTypeDesc: { type: "string",editable: false, defaultValue: "Fuel" },
                            StatusName: {type: "string" },
                            Departure_Date: { type: "date"},
                            Arrival_Date: {type: "date"},
                            FlightNumber: { type: "string" },
                            AircraftName: {type: "string" },
                            TerminalAndGate: { type: "string" },
                            AirlineName: {type: "string", defaultValue: { AirlineID: 1, AirlineName: "135 Airways"} },
                            DestinationAirportCode: { type: "string", defaultValue: { LocationID: 1, AirportCode: "ATL"} },
                            ArrivalAirportCode: { type: "string", defaultValue: { LocationID: 1, AirportCode: "ATL"} },
                            ShipNumber: { type: "string" },
                            TailNumber: { type: "string" },
                            Product: { type: "string" },
                            FuelQuantity: { type: "string" },
                            Temperature: { type: "string" },
                            Density: { type: "string" },
                            StartTotalizer: { type: "string" },
                            StopTotalizer: { type: "string" },
                            TotalGallons: { type: "string" },
                            FuelEquipment: { type: "string" },
                            Fueler: { type: "string" },
                            InOpGuage: { type: "string" },
                            Supplier: { type: "string" },
                            StartTime: { type: "string" },
                            EndTime: { type: "string" },
                            FuelCaps: { type: "string" },
                            Notes: { type: "string" }
                        }
                    }
                }

0
Vladimir Iliev
Telerik team
answered on 19 Nov 2013, 07:39 AM
Hi Johny,

In current case you should only remove the type option for the "AirlineName", "DestinationAirportCode" and "ArrivalAirportCode" fields:

AirlineName: {defaultValue: { AirlineID: 1, AirlineName: "135 Airways"} },

Also you can check our "Editing custom editor" demo which demonstrates the same scenario. 

Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
JOHNY
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
JOHNY
Top achievements
Rank 1
Share this question
or