Telerik Forums
Kendo UI for jQuery Forum
2 answers
119 views
Hello,

I use kendo-ui datasource and grid with the SharePoint 2010 list odata service. I need to enable batch editing. As mentioned in this article:

http://msdn.microsoft.com/en-us/library/ff798339

the SharePoint 2010 list odata service supports batching though multipart mime messages. It appears kendo ui does batching by sending accross a request per operation type update/destroy/create (in what order?), where each request contains a collection of the objects involved, which requires a parameterMap as follows:

                parameterMap: function (options, operation) {
                    if (operation !== "read" && options.models) {
                        return { models: kendo.stringify(options.models) };
                    }
                }

Does kendo ui support the multipart mime message way of doing batching?

cheers

Remco 
Remco
Top achievements
Rank 1
 answered on 21 Sep 2012
6 answers
819 views
Is it possible in the grid to select multiple rows and edit them as 1? So can I select 20 rows and with one click set some value to true?

Nohinn
Top achievements
Rank 1
 answered on 21 Sep 2012
0 answers
252 views
Hi All,
The list of elements shown in a listview are not getting paged depending on the no. entered in the code in cshtml.
For example :

@(Html.Kendo().ListView<Kendo.Mvc.Examples.Models.ProductViewModel>(Model)
    .Name("listView")
    .TagName("div")
    .ClientTemplateId("template")
    .DataSource(dataSource => {
        dataSource.Read(read => read.Action("Products_Read", "ListView"));
        dataSource.PageSize(12);
    })
    .Pageable()        
)

Though we mention 12 in the pagesize, I am getting all my records to the view. Please help how to show the no. of
records as per our choice.


Regards,
Rohit


Rohit
Top achievements
Rank 1
 asked on 21 Sep 2012
3 answers
1.3K+ views
Hi,

How do I prevent dataSource from making request to server?
I have a costly set of data and so stored the JSON in client cache (local storage), so that even after the user navigate away from the page and back, already read data from server would be available rather than making another call to receive same data back again.

I am using local cache to store the data once read from server and want to prevent dataSource from making subsequent request when found in cache.

I tried the following, but it did not work, is there anyway to achieve this?

    var ds = new kendo.data.DataSource({
        transport: {
            read: {
                url: 'url to get data',
                dataType: "json"
            }
        },
        change: OnDataChange,
        requestStart: OnDataRequestStart
    });
 
function OnDataChange(e) {
    if (IsDataRequested) {
        // save it to cache
        $.jStorage.set("LargeData", e.sender.data());
        IsDataExists = true;
        IsDataRequested = false;
    }
}
 
function OnDataRequestStart(e) {
    if (IsDataExists) {
        e.preventDefault();
    }
    else {
        // Check if "key" exists in the storage
        var value = $.jStorage.get("LargeData");
        if (value) {
            IsDataExists = true;
            e.preventDefault();
            e.sender.data(value);
        }
        else {
           // Read data from server
            IsDataRequested = true;         }     } }

Thanks
Muthu
Alexander Valchev
Telerik team
 answered on 21 Sep 2012
6 answers
488 views
Hello,

I'm trying to use Kendo UI with a MVC 4 app but I get the following error:

Object doesn't support property or method 'on'

I've tried including the jquery.min.js that comes with Kendo but it still does not work. MVC uses jQuery v 1.6.2 by default.  I've also tried removing the 1.6.2 reference and using the 1.7.1 (aka jquery.min.js that comes with Kendo), but that too causes other code to fail.  Any suggestions would be appreciated.

- Rashad
Rashad Rivera
Top achievements
Rank 1
 answered on 21 Sep 2012
0 answers
152 views
I have an object with data I that I want to use to fill a list. When someone clicks a link it triggers the javascript below and the value from e.view.params.street_id is taken (for example: 2) and filters the obj's street_id field. I then want to take data from the filtered objects in the "addresses" parameter, and fill #template (below) with the data from that. Can I do that? and how?

<script id="template" type="text/x-kendo-template">
        <span>${street_number}</span>
       <span>${notes}</span>
</script>

var obj = [
    {
        "street_id": "1",
        "street_name": "First St",
        "addresses": [
            {
                "street_number": "100",
                "notes": "Example notes..."
            },
            {
                "street_number": "101",
                "notes": ""
            }
        ]
    },
    {
        "street_id": "2",
        "street_name": "Second St",
        "addresses": [
            {
                "street_number": "200",
                "notes": ""
            },
            {
                "street_number": "201",
                "notes": "Test notes..."
            }
        ]
    }
];
 
var template = kendo.template($('#template').html());
 
var dataSource = new kendo.data.DataSource({
    data: obj,
    filter: {
        field: 'street_id',
        operator: 'eq',
        value: e.view.params.street_id
    },
    change: function() {
        $('#streets').html(kendo.render(template, this.view()));
    }
});

dataSource.read();
Vince
Top achievements
Rank 1
 asked on 20 Sep 2012
4 answers
237 views
With reference to the attached image

Following is the behavior:
  • Issue happens only on the first drop panel that is clicked, once its open it doesn't close, all the other combos work except the first one that is clicked.
  • Issue does not happen when there is more content on the page, basically page height is large enough.

We are using Select tag and convert it to combobox

$(this).kendoComboBox({
    filter: "contains",
    height: 200,
    change: function (e) {
        if (this._selected == null) {
            this.text("(None)");
        }
    }
});

We are using:
jQuery v1.7.1
Kendo UI v2011.3.1129
ASP.Net MVC 3 (not sure if that matters)

Adrian
Top achievements
Rank 1
 answered on 20 Sep 2012
0 answers
267 views
As an example the below code is using a kendo observable with a remote datasource model and view.  I understand how to debug the ajax call to retrieve the data.  But where and how do I verify that the data matches the model, then when I bind my form to my viewModel where do I debug this is for example the dropdownbox is not filling with data even though the ajax data request was a success and see the ajax response in the debugger.  But can't tell where my error is??

    <!DOCTYPE html>
<html>
<head>
    <title></title>
    <script src="js/lib/jquery/jquery-1.8.1.min.js"></script>
    <script src="js/lib/kendoui/kendo.web.min.js"></script>
    <link href="css/KendoUI/kendo.common.css" rel="stylesheet" />
    <link href="css/KendoUI/kendo.blueopal.css" rel="stylesheet" />
</head>
<body>
     
<div id="example" class="k-content">
    <div id="form-container">
        <div class="demo-section">
            Select Product: <select data-role="dropdownlist" data-option-label="Select product"
                             data-value-field="ID" data-text-field="lastName"
                             data-bind="source: productsSource, value: selectedProduct"></select>
 
            <button data-bind="click: save, enabled: hasChanges" class="k-button">Submit All Changes</button>
        </div>
        <div class="demo-section product-info"></div>
            <ul>
                <li><label>ID</label> <span data-bind="text:selectedProduct.ID, events: { change: change }"></span></li>
                <li><label>Last Name</label> <input type="text" class="k-textbox" id="lname" data-bind="value: selectedProduct.lastName, events: { change: change }" /></li>
            </ul>
 
            <button data-bind="click: remove" class="k-button">Delete Product</button>
 
        </div>
    </div>
    <script>
    var crudServiceBaseUrl = "http://127.0.0.1:8081/cors";
                var viewModel = kendo.observable({
                    productsSource: new kendo.data.DataSource({
                        transport : {
                            read:  function(operation) {
                                //alert("begin read")
                                    $.ajax({
                                    url: crudServiceBaseUrl + "/People",
                                    dataType: "json",
                                    success: function(response) {
                                    //  debugger;
                                        //alert(response)
                                    alert("success read"); //mark the operation as successful
                                    },
                                    error: function(e){
                                        alert("error")
                                    }
                                });
                            },
                        },
                    batch: true,
                    schema: {
                       data : "__ENTITIES",
                            model : {
                                id : "ID",
                                fields : {
                                    __KEY : {
                                        editable : false,
                                        nullable : true
                                    },
                                    __STAMP : {
                                        editable : false,
                                        nullable : true
                                    },
                                    ID : {
                                        editable : false,
                                        nullable : true
                                    },
                                    firstName : {
                                        validation : {
                                            required : true
                                        }
                                    },
                                    lastName : {
                                        validation : {
                                            required : true
                                        }
                                    }
                                }
                            }
                    }
                }),
                selectedProduct: null,
                hasChanges: false,
                save: function() {
                    this.productsSource.sync();
                    this.set("hasChanges", false);
                },
 
 
                remove: function() {
                    if (confirm("Are you sure you want to delete this product?")) {
                        this.productsSource.remove("1");
                       // this.set("selectedProduct", this.productsSource.view()[0]);
                        this.change();
                    }
                },
                // showForm: function() {
                   // return this.get("selectedProduct") !== null;
                // },
 
                change: function() {
                    this.set("hasChanges", true);
                }
            });
            alert("bind")
           
              kendo.bind($("#form-container"), viewModel);
          
                </script>
                </body>
</html>
Daniel
Top achievements
Rank 2
 asked on 20 Sep 2012
0 answers
148 views
I'm trying to bind a chart using MVVM, but get this error:  "Uncaught Error: The dataSource binding is not supported by the Chart widget"

Here is my template:
    <script id="chart-template" type="script/x-kendo-template">
        <div data-role="chart" data-series-field="value" data-categoryaxis-field="category" data-seriesdefaults-type="column" data-bind="dataSource: #: parent().parent().dataSource #" class="chart"></div>
    </script>

I'm using parent to get back to the chart array's main object, since it has the datasource.  If it would have worked, I would have switched that to a function that would return a new datasource specific to each chart.  Is my template totally wrong, or can you really just not bind a chart's dataSource with templates yet?  I'm a Kendo newbie, so I could easily be messing this up.  Thanks!

Edit:  
Ok, so now I got this when trying to declaratively bind the tabstrip's activate event: "Error: The activate binding is not supported by the TabStrip widget".  This whole declarative initialization really seems half-baked.  Can someone please comment on this?  If this is the case, can you at least indicate in the documentation whether each property/event can be declaratively databound?


Michael
Top achievements
Rank 1
 asked on 20 Sep 2012
0 answers
89 views
On the html:

data-bind="style: {backgroundImage: imgSrc}"

On the observable:

imgSrc: function() { return 'url(' + this.get('filename') + ')'; }

In IE8:

this.element.style[a]=this.bindings.style[a].get() throws "Invalid argument."

this.bindings.style[a].get:

function(){
var a=this,b=a.source,c,d=a.path,f=b;
a.start();
if(a.observable) {
f=b.get(d);
while(f===undefined&&b)
b=b.parent(),b instanceof e&&(f=b.get(d));
typeof f=="function"&&(c=d.lastIndexOf("."),c>0&&(b=b.get(d.substring(0,c))),f=k(f,b),f=f(a.source)),b&&b

 
Matt
Top achievements
Rank 1
 asked on 20 Sep 2012
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
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
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?