Telerik Forums
Kendo UI for jQuery Forum
1 answer
195 views
I have a Kendo Scheduler posting to a C# Web API when a new schedule event is created.  The problem is with parameter binding - the web API method does not receive the posted data properly.

When I look at the server request in Fiddler, the content type is json, but the request body is URL encoded. How to get the Scheduler to encode the event as JSON?


POST http://localhost:58623/api/booking HTTP/1.1
Host: localhost:58623
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json; charset=utf-8
Referer: http://localhost:58623/Booking
Content-Length: 2141

models=%5B%7B%22Id%22%3A0%2C%22Title%22%3A%22No+title%22%2C%22Start%22%3A%222013-06-11T08%3A00%3A00.000Z etc...

Here is my js file:

        $("#scheduler").kendoScheduler({
            date: new Date("2013-06-13"),
            startTime: new Date("2013-06-13T07:00"),
            endTime: new Date("2013-06-13T23:59"),
            height: 800,
            views: [
                "day",
                { type: "week", selected: true },
                "month",
                "agenda"
            ],
            timezone: "Etc/UTC",
            dataSource: {
                batch: true,
                transport: {
                    read: {
                        url: "/api/booking",
                        dataType: "json"
                    },
                    update: {
                        url: "/api/booking",
                        type: "PUT",
                        dataType: "json"
                    },
                    destroy: {
                        url: function (rec) {
                            return "/api/booking/" + rec.Id;
                        },
                        type: "DELETE"
                    },
                    create: {
                        url: "/api/booking",
                        type: "POST",
                        dataType: "json",
                        contentType: 'application/json; charset=utf-8'
                    },
                    parameterMap: function (options, operation) {
                        if (operation !== "read" && options.models) {
                            return kendo.stringify(options.models);
                        }
                    }
                },
                schema: {
                    model: {
                        id: "id",
                        fields: {
                            id: { from: "Id", type: "number" },
                            title: { from: "Title", defaultValue: "No title", validation: { required: true } },
                            start: { type: "date", from: "Start" },
                            end: { type: "date", from: "End" },
                            startTimezone: { from: "StartTimezone" },
                            endTimezone: { from: "EndTimezone" },
                            description: { from: "Description" },
                            recurrenceId: { from: "RecurrenceId" },
                            recurrenceRule: { from: "RecurrenceRule" },
                            recurrenceException: { from: "RecurrenceException" },
                            clubId: { from: "ClubId", nullable: false, defaultValue: 0 },
                            fieldId: { from: "FieldId", nullable: false, defaultValue: 0 },
                            lightIds: { from: "LightIds", nullable: false, defaultValue: 0 },
                            isAllDay: { type: "boolean", from: "IsAllDay" }
                        }
                    }
                }
            },
            resources: [
            {
                field: "fieldId",
                dataSource: [
                    { text: "Main Oval", value: 1, color: "#6eb3fa" },
                    { text: "Practice Oval", value: 2, color: "#f58a8a" }
                ],
                title: "Club"
            },
            {
                field: "lightIds",
                dataSource: [
                    { text: "Match Lights", value: 1, color: "#f8a398" },
                    { text: "Auxilliary Lighting", value: 2, color: "#51a0ed" },
                    { text: "Practice Lights", value: 3, color: "#56ca85" }
                ],
                multiple: true,
                title: "Lights"
            }
            ]
        });


Atanas Korchev
Telerik team
 answered on 16 Sep 2013
1 answer
92 views
I have a custom bound ajax grid with server operation (for paging, sorting, filtering etc). On the server side it would sometimes be more efficient to fetch all the data rather than just one page. If I return more than a page worth of data the grid just shows it all (as you would expect!), so what I want to do is switch to client side paging if more than a page worth of data is returned... is this possible?

I've tried setting the option on the grid during the DataSource.RequestEnd event, but this doesn't seem to have any real effect (I've tried also calling grid.Refresh, grid.SetDataSource).
Nikolay Rusev
Telerik team
 answered on 16 Sep 2013
4 answers
149 views
Dear Telerik,

I use grid in my project and would like to provide multi-select options in user-editing. But I got some strange issue using multi-select.
In my project I use multi-select like this. 
$("#grid").kendoGrid({
                    dataSource: dataSource,
                    pageable: true,
                    resizable: true,
                    sortable: true,
                    filterable: true,
                    toolbar: ["create"],
                    save: function (e) {
                        e.model.dirty = true;
                    },
                    detailTemplate: kendo.template($("#template").html()),
                    detailInit: detailInit,
                    columns: [
                        //{ field: "id", title: "id Name" },
                        { field: "Server_Name", title: "Server Name", width: "150px" },
                        { field: "Server_IP_Address", title: "Server IP Address", width: "120px" },
                        { field: "Data_Center_City", title: "City", width: "56px" },
                        { field: "Data_Center_Location", title: "Data Center Location", width: "156px" },
                        { field: "Server_Type", title: "Server Type", width: "100px" },
                        { field: "Server_Instance", title: "Server Instance", width: "120px" },
                        { field: "Environment", title: "Environment", width: "100px", editor: appDropDownEditor },
                        { command: ["edit", "destroy"], title: " ", width: "170px" }],
                    editable: "inline"
                });
            }
 
function appDropDownEditor(container, options) {
            $('<input required data-bind="value:' + options.field + '"/>')
                .appendTo(container)
                .kendoMultiSelect({
                    dataTextField: "text",
                    dataValueField: "text",
                    dataSource: [ { text: "PRD" }, { text: "QA" }, { text: "DEV" } ]
                });
        }
I wonder where I got wrong and it appeared with a strange <input> and a <span> unexpected. Just like the image.

I'd like to ask you that how can I use multi-select to get user input in dropdown list? I checked the demos but only found demo for <select> tag or for MVC usage.
I'm looking forward for your reply.
hongbo
Top achievements
Rank 1
 answered on 16 Sep 2013
4 answers
318 views
Hello,

I'm trying to integrate Bootstrap menu through Kendo UI template.

I'm getting JSON values from MVC controller and rendering it's values to the template but I'm getting ReferenceError:  MenuText is not defined.

I tried using #: data.MenuText # / #: MenuText # but I still get same result, when I dot this #: data # it returns [object, Object]


Please advise
D

MVC controller
public ActionResult GetMenu()
     {
         _menu = GenerateMenuValues();
 
         return Json(_menu, JsonRequestBehavior.AllowGet);
 
     }
 
     private List<MenuValues> GenerateMenuValues()
     {
         return new List<MenuValues>()
         {
             new MenuValues(){Active = "active", MenuText = "Home", Url = "\\#"},
             new MenuValues(){MenuText = "Web widget", Url="\\#", SubMenu = new List<MenuValues>()
             {
                 new MenuValues(){MenuText = "Grid widget", Url = Url.Action("GridWidget","Home")},
                 new MenuValues(){MenuText = "Auto complete", Url = Url.Action("AutoCompleteWidget","Home")},
                 new MenuValues(){MenuText = "Combo box", Url = Url.Action("ComboBoxWidget","Home")},
                 new MenuValues(){MenuText = "Dropdown List", Url = Url.Action("DropdownListWidget","Home")},
                 new MenuValues(){MenuText = "Numeric text", Url = Url.Action("NumericTextbox","Home")},
                 new MenuValues(){MenuText = "Window", Url = Url.Action("WindowWidget","Home")},
                 new MenuValues(){MenuText = "Tree view", Url = Url.Action("TreeViewWidget","Home")},
                 new MenuValues(){MenuText = "Tab strip", Url = Url.Action("TabStrip","Home")}
             }},
             new MenuValues(){MenuText = "Data Source", Url = Url.Action("DataSource","Home")},
             new MenuValues(){MenuText = "MVVM", Url = Url.Action("Mvvm","Home")}
 
 
         };
     }
HTML markup / template
<script type="text/x-kendo-template" id="menuTemplate">
        <div class="col-md-12">
            <nav class="navbar navbar-static-top" role="navigation">
                 
            <div class="navbar-header">
                <a class="navbar-brand" href="\#">Learning Kendo</a>
            </div>
                     
                <ul class="nav navbar-nav">
                 
              <li> #= MenuText # </li> // just to test that values are rendering
      
    </ul>
        </nav>
        </div>
</script>
<script type="text/javascript">
 
    $(document).ready(function () {
        var dataService = '/DataServices/';
        var menuData = $.getJSON(dataService + 'GetMenu');
        var menuTemplate = kendo.template($('#menuTemplate').html())(menuData);
        $('#templateMenu').html(menuTemplate);
 
    });
 
 
</script>

Mark
Top achievements
Rank 1
 answered on 14 Sep 2013
1 answer
118 views
I have some concerns on the viability of migrating from ASP.NET Scheduler to Kendo UI scheduler. Particularly, the manner in which recurrence is handled in the two products is handled. It would be VERY GOOD if both systems store data in the same way. At the very least, have a way to convert data over from one system to the other.

Otherwise, migration would be very hard to do.

Thanks,

Brian
Georgi Krustev
Telerik team
 answered on 13 Sep 2013
1 answer
107 views
It doesn't seem to work for me
It is supposed to but I haven't found complete documentation on how to do this. For example I was able to set Virtual to true with the following code(note I am using MVC extensions).
.Scrollable(s => s.Virtual(true).Height(532))
The server code
public ActionResult IndexEmployeesGridData([DataSourceRequest] DataSourceRequest request)
{  
    var model = _employeeService.GetEmployeesDataViewModel(request.Page, request.PageSize).Where(e => e.IsActive);
    return Json(model.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}


Code works for the first page only.

The grid fills up with the first page of data but nothing else. Since the grid has no idea how many rows are in the database it just forgets about any more records. I don't know how to complete the last part to get the dynamic virtual paging  to work properly. Any help would be greatly appreciated. 

Thanks

1 hour ago (Link to this post)

It doesn't seem to work for me
It is supposed to but I haven't found complete documentation on how to do this. For example I was able to set virtualization to true with the following code(note I am using MVC extensions).
.Scrollable(s => s.Virtual(true).Height(532))
This of course doesn't work well for large datasets because you have to have some sort of paging set up on the server. There is documentation saying that you should add the parameters page, pageSize, take, and skip etc.. in order for this to work. I did this but then I get an error. 

The server code
public ActionResult IndexEmployeesGridData([DataSourceRequest] DataSourceRequest request, Int32 page, Int32 pageSize)
{  
    var model = _employeeService.GetEmployeesDataViewModel(page, pageSize).Where(e => e.IsActive);
    return Json(model.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
The erorr message
Server Error in '/' Application.The parameters dictionary contains a null entry for parameter 'page' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult IndexEmployeesGridData(Kendo.Mvc.UI.DataSourceRequest, Int32, Int32)' in 'SafetyPlus.Controllers.EmployeeController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters

Using the Data property I was able to get data to the server. 
.DataSource(datasource => datasource
    .Ajax()
    .PageSize(20)
    .Read(read => read.Action("IndexEmployeesGridData", "Employee").Data("sendStatus"))))
And the script that gets the parameters to take. 
<script type="text/javascript">
 
    function sendStatus(options)
        return {
            page: options.page,
            pageSize: options.pageSize
        };
    }
</script>
Help needed.
The grid fills up with the first page of data but nothing else. Since the grid has no idea how many rows are in the database it just forgets about any more records. I don't know how to complete the last part to get the paging to work properly. Any help would be greatly appreciated. 

Thanks
Daniel
Telerik team
 answered on 13 Sep 2013
4 answers
211 views
Hi,

I was trying to create a quick KendoUI demo with a small table.

The table is about 14 columns with 139 row.

The demo consists of a chart to display the first row of the grid and 2 grids just to test that it is possible to show 2 grids...

I used firebug to test the load time... it takes 1.39 secs on average... would like it to be fast if possible...

But what is annoying is that when I click to another page on the grid, each page showing only 10 records, it takes over 2 seconds?!?

I don't understand why it takes longer to page across pages than to load the entire page...

I also tried this via AJAX using MVC but the same page takes 6 seconds to load and paging there takes 6 seconds too...

Can anyone tell me why the demo I am using with BindTo is taking so long to page between pages?

I've been looking at JQgrid and its instantaneous there.... I can't see why it is so slow in KendoUI....


Regards,

William
Petur Subev
Telerik team
 answered on 13 Sep 2013
1 answer
268 views
hi guys
i try to use the time picker and date picker  (after following the mvvm demo on demo section) in my mobile app with no success.
other widgets such dropdownlist and combobox are work.
also i googled it and did not found any note that say its not applicable.
i use icenium and kendo mobile&web for the development.
hope you will help me or can provide me a link to date picker for mobile.
best regards 
maor
Kiril Nikolov
Telerik team
 answered on 13 Sep 2013
5 answers
627 views
Hi,

I just want to know how to post data using the parameterMap function in kendo scheduler, as what I understand the default type is "Get", for some reason I need to do a "Post" type, It seems that my code (see sample code below) does not work, and when I look into the posted data the result is always something like this ( f=%22somedata%22 ) Is there something  wrong in my code? 

dataSource: {
  transport: {
       read: {
      type: "POST",
      url: "myurl",
      dataType: "json",
      contentType: "application/json; charset=utf-8"
 
       },
       parameterMap: function (options, operation) {
                                           
         return { f: JSON.stringify("somedata") };
         }
       },
        schema:
               {
                   //some code here....
               }
 }
I also try the code below as what I see in this link http://jsfiddle.net/Xhrrj/4/.. but it seems not working to me.. the result of the posted data is something like this ( f= somedata )...
parameterMap: function (options, operation) {
                                                                                    $.extend({}, options, { f: "somedata" })
                                        }

 
Thanks,

Regards, 
Jesson
Jsn
Top achievements
Rank 1
 answered on 13 Sep 2013
1 answer
48 views
Hi All,

I am trying to prevent the user from entering values again and again when the application starts. I want the user to store the values only once.   Let me know if there is any method in Icenium that can store the values like how there is plist in IOS. 

Thanks

Gaja Naik
Filip
Top achievements
Rank 1
 answered on 13 Sep 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
BulletChart
Licensing
QRCode
ResponsivePanel
TextArea
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?