Telerik Forums
Kendo UI for jQuery Forum
2 answers
98 views
I have a situation where I need to retrieve some data from my server, and then populate my view model with it. However when I do that, the bindings get overwritten. So I have a function to re-wire the functions and such for all of the various objects, and this seems to work fine; Except for this one situation where a sub-array of a top level property has an onCreate function.

The best I can see, when I start the page, the onCreate function has a property called "guid'. When I use the set function to apply the server side data to the array, that property is taken away, and I cannot seem to get it back. So the Click event fails with an error.

I have a jsBin sample here;

jsBin

Daniel
Telerik team
 answered on 02 Dec 2013
1 answer
136 views
I've created a Kendo Grid and need to add a column containing a hyperlink to a controller action that supplies the clicked row's ID.  The grid would look like:

ID|Name|Product|Other|Edit, where the edit column links to '~/controller/action/currentRowID'.  

The grid is working perfectly, all that's needed is the 'Edit' row.  I'm using MVC4 using an ajax datasource.  Please help!  I cannot find anything on the web that describes how to accomplish this.
Dimiter Madjarov
Telerik team
 answered on 02 Dec 2013
3 answers
113 views
Hi,

I've a problem with multiple of your sample apps when running e.g. on an iPhone or iPad.

e.g. If I go to http://demos.kendoui.com/mobile/m/index.html#/mobile/m/tabstrip/index.html and select the rating tab then I go to another browser tab or another app. When returning to the tabs trip sample safari might reload the page.

expected result: I see the same page after returning

result: I get an empty page

you can force this by touching reload. Again expected result: seeing the page I've seen before. Result: empty page

I have seen this behavior in all of your samples. So I'm wondering if that's broken by design or how it can be fixed?

Petyo
Telerik team
 answered on 02 Dec 2013
2 answers
75 views
Hi,

I use Kendo DateTimePicker that can set Min/Max of the widget, set a range time stamp that I can select in this widget. For example,
Set interval = 30, min=  new Date(2013,11, 12, 10, 0, 0), max = new Date(2013, 11, 12, 20, 0, 0)
I can select range from 2013-11-12 10:00 to 2013-11-12 20:00, include the 2 points of start and end.

But when set interval = 30, min=  new Date(2013,11, 12, 10, 0, 0), max = new Date(2013, 11, 12, 10, 0, 0).
I think there should only a value can be select in widget, but it will return a wrong list.

Thanks,
Chuanlong 
Chuanlong
Top achievements
Rank 1
 answered on 02 Dec 2013
11 answers
277 views
Hi,

I updated to iOS 7 and xCode 5 and Drawer doesn't recognize swipe gestures (i.e. left-to-right) anymore performed on iOS 7 device or in iOS Simulator.
It's working as expected on local browser and was working on ios 6 device.
I'm using kendoui.mobile.2013.2.912.commercial wiht new ios 7 theme.

Any suggestions?
Thanks in advance


 
upvision
Top achievements
Rank 1
 answered on 01 Dec 2013
8 answers
1.6K+ views
Hi All,

I have a local datasource bound to an array of objects.  This array looks something like (peopleData is a global object in this example):
peopleData = [
    { Id: "jaaron", FirstName: "John", LastName: "Aaron", Age: 46 },
    { Id: "agent2", FirstName: "Jayne", LastName: "Smith", Age: 13 }];

I am able to create a datasource using this local array with the following code (peopleDS is a global object in this example):
peopleDS = new kendo.data.DataSource({
    data: peopleData,
    change: function (e) {
        console.log(this.data().length + ' records');
    }
});

Now, I want to edit one of elements of the array.  My current approach is to just iterate over the array and change the element I am looking for, like this:
for (var i = 0; i < peopleData.length; i++) {
    if (peopleData[i].Id === "jaaron") {
        peopleData[i].Age = 55;
        break;
    }
}
peopleDS.read(peopleData);

My question is - is there a more efficient way to do this?  This array may grow to 1000 elements, which change frequently and I would rather not iterate over the entire array each time I need to change an element (although I realize it may be my only option).

On a side note:
The optimal solution, for me, would be to somehow bind an associative array to the datasource (although since it isn't really an array, I imagine isn't possible).  For instance, I would like to be able to display the FirstName, LastName, and Age of the following object using a KendoUI datasource:
peopleData = {};
peopleData["jaaron"] = { FirstName: "John", LastName: "Aaron", Age: 46 };
peopleData["agent2"] = { FirstName: "Jayne", LastName: "Smith", Age: 13 };

As always, thanks in advance for any help!
Roatin Marth
Top achievements
Rank 1
 answered on 29 Nov 2013
2 answers
515 views
Hi all!

As you can see in the code below, i have a grid with editable cells. At the column named "szin" i tired to implement a kendo colorpicker and it works just fine.
My problem is, that the colors are only displayed when you try to edit one of the cell. Can i make it permanently displayed somehow? I dont care if the bg-color of the cell change or the dropdown box visible all the time or with any other methods.

Here's my code:
<!DOCTYPE html>
<html>
    <head>
        <link href="../styles/kendo.metro.min.css" rel="stylesheet">
        <link href="../styles/kendo.common.min.css" rel="stylesheet">
        <script src="../js/jquery.min.js"></script>
        <script src="../js/kendo.all.min.js"></script>
    </head>
    <body>
        <div id="grid" style="width:1024px; height:400px; margin-left:auto; margin-right:auto;"></div>
        <script>
            $(document).ready(function() {
                $("#grid").kendoGrid({
                    dataSource: {
                        transport: {
                            read: "load.php",
                            update: {
                                url: "load.php",
                                type: "POST"
                             
                            }/*,
                            destroy: {
                                url: "load.php",
                                type: "DELETE"
                            }*/
                             
                        },
                        error: function(e) {
                            alert(e.responseText);
                        }
                    },
                    columns: [  { field: "termekid", width:"70px" },
                                /*
                                ...
                                */
                                { field: "szin", width:"74px",
                                    editor: szinColorPickerEditor
                                }
                                /*
                                ...
                                */
                                 
                            ],
                    sortable: true,
                    editable: true,
                    navigatable: true,
                    toolbar: ["save", "cancel"/*, "create"*/],
                    pageable: {
                            previousNext: true,
                            numeric: true,
                            buttonCount: 5,
                            input: false,
                            pageSizes: [0, 10, 20, 50, 100],
                            refresh: true,
                            info: true
                             
                             
                        }
                     
                });
                 
                function szinColorPickerEditor(container, options) {
                    $("<input type='color' data-bind='value:" + options.field + "' />")
                        .appendTo(container)
                        .kendoColorPicker({
                            buttons: true
                             
                        });
                         
                }
                 
                 
            });
             
        </script>
    </body>
</html>

Bence
Top achievements
Rank 1
 answered on 29 Nov 2013
2 answers
276 views
Considering the following data object:

var obj = {
person: {
name: "Holmes"
address: {
apt: 221B,
street: "Baker",
city: "London"
    }
  }
}

And the viewModel built from the above object to be used in a MVVM presentation:
var viewModel = kendo.observable(obj);
kendo.bind(..., viewModel)

After the changes have been done to the viewModel by UI,
I would like to extract the original object as a whole (rather then field by field)
with the changes incorporated in it.

The extracted object would be then sent to another part of the application for processing
and is expected to have no additional events/functions/types built into it.
In other words, I would like to detach the "observable" from the object.

How can I do that?
Thanks,
Andrew
Andrew
Top achievements
Rank 1
 answered on 29 Nov 2013
1 answer
81 views
What i am trying to do is use partial views with kanedo ui. I want to have my views in one folder and load them according to navigation. Is there a simple way to do this? I tried accomblishing this by using angularjs but it didn't work very well.
Alexander Valchev
Telerik team
 answered on 29 Nov 2013
3 answers
137 views
Does the resize api also make it possible to apply vertical resizing ?
I'm trying to apply this on a grid contained in a splitter pane, but end up with the grid height being more the the pane height.
It would be nice if kendo widgets like the grid, listbox, scheduler, charts would be able stretch vertically to their parent container without having to change css classes and doing calculations yourself.

At the moment to my experience it's not that easy to create a SPA business application which would always be filling the entire viewport.
Dimo
Telerik team
 answered on 29 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?