Telerik Forums
Kendo UI for jQuery Forum
1 answer
113 views
Hey,

I have an observable object looking something like this:

1.viewModel = kendo.observable({
2.    anArray: ['item1', 'item2', '...'],
3.    filteredArray: function() {
4.        return this.get('actions').filter(function (el) {
5.            return someLogic(el);
6.        });
7.    }
8.});
So far so good. No I want to use this filtered array in a source binding (to generate a table, say) and I want to to the following:

1.<script id="row-template" type="text/x-kendo-template">
2.    <tr>
3.        [...]
4.        <td><select data-bind="source: availableDescriptions, value: Description"/></td>
5.    </tr>
6.</script>
Where availableDescription is an array contained in my viewModel.
This generates an error (Uncaught TypeError: Object [object Array] has no method 'parent' )

Apparently kendo is resolving 'availableDescriptions' by calling 'parent()' on the observable array that is the context for my template. To work around this I changed my implementation of filteredArray to look like this:

1.filteredArray: function () {
2.    var a = this.get('actions').filter(function (el) {
3.        return doSomething(el);
4.    });
5.    a.parent = function () { return this; };
6.    return a;
7.}
It works, but isn't particularly graceful. Is there a better way to do this ?
Alexander Valchev
Telerik team
 answered on 17 Jul 2013
1 answer
101 views
Hi, Foreign key columns in the grid are not being grouped by text rather by foreign key id. Any recommendations as to how can we group by text of the foreign key col.

Thanks
Vladimir Iliev
Telerik team
 answered on 17 Jul 2013
3 answers
142 views
I have created a list view and when you click on one of the objects it opens a further details page.
This works ok except that the button on the details page is only showing text.
The following is an example so if you click on one of the objects in the list view the next page the word Website should be a button.
http://jsbin.com/edaciy/1
The following is the code
http://jsbin.com/edaciy/1/edit
Thanks.
Kiril Nikolov
Telerik team
 answered on 17 Jul 2013
2 answers
61 views
Everything on my grid is working great except when they click update and then cancel they get an error. "Unexpected number"

Here is the code. the functions applist, companylist, etc just populate the edit dropdowns. They seem to be generaign find though. Any ideas?

var crudServiceBaseUrl = "main.php?a=quote_detail", dataSource = new kendo.data.DataSource({
    transport : {
        read : {
            url : crudServiceBaseUrl + "&read=1",
            dataType : "json"
        },
        update : {
            url : crudServiceBaseUrl + "&update=1",
            dataType : "json",
            complete: function(e) {
                        $("#grid").data("kendoGrid").dataSource.read();
            }                   
        },
        destroy : {
            url : crudServiceBaseUrl + "&destroy=1",
            dataType : "json"
        },
        create : {
            url : crudServiceBaseUrl + "&create=1",
            dataType : "json",
            complete: function(e) {
                        $("#grid").data("kendoGrid").dataSource.read();
            }                   
        }
    },
    batch : true,
    pageSize : 10,
    serverPaging : true,
    serverFiltering : true,
    serverSorting : true,
    
    schema : {
        data: "data",
        total: "total",
        model : {
            id : "ID",
            fields : {
                company : {
                    validation : {
                        required : true
                    }
                },
                effective_date : {
                    validation : {
                        required : true
                    }
                },
                fee : {
                    validation : {
                        required : true
                    }
                },
                guarantee : {
                    validation : {
                        required : true
                    }
                },
                state : {
                    validation : {
                        required : true
                    }
                },
                application : {
                }
            }
        }
    }
});
 
$("#grid").kendoGrid({
    dataSource : dataSource,
    pageable : true,           
    height : 430,
    refresh: true,           
    toolbar : ["create"],
    columns : [{
        field : "company",
        title : "Company",
        editor: companyList
    }, {
        field : "effective_date",
        title : "Effective Date"
    }, {
        field : "fee",
        title : "Fee"
    }, {
        field : "guarantee",
        title : "Guarantee"
    }, {
        field : "state",
        title : "State",
        editor: stateList
    },
    {
        field : "application",
        title : "Application",
        editor: appList           
    },
    {
        command : ["edit", "destroy"],
        title : " ",
        width : "160px"
    }],
    editable : "inline"
});
Kiril Nikolov
Telerik team
 answered on 17 Jul 2013
4 answers
1.0K+ views
Hi,

I wish to create a combobox which when user enter 3 character
then the data source retrieve filtered data from server with the POST variable of keyword.

But i cant make the data source retrieve new data with combobox text, here is my code:

                var combo=$("#input_customer").kendoComboBox({
                dataTextField: "title",
                dataValueField:"entry_id",
                filter:"contains",
                minLength: 3
            }).data("kendoComboBox");
 
            var customer_ds=new kendo.data.DataSource({
                transport: {
                    read: {
                        type:"POST",
                        dataType: "json",
                        serverFiltering:true,
                        data:{keywords:combo.text()},
                        url: "ajax/customer"
                    }
                }
            });
 
            $("#input_customer").data("kendoComboBox").setDataSource(customer_ds);

Alexander Valchev
Telerik team
 answered on 17 Jul 2013
1 answer
95 views
Having an issue with data binding and click events being fired multiple times.

I have a master view object that binds data to a view on init.

View.prototype.init = function (e)
{
this.id = e.view.id;
this.elm = e.view.element;
this.view = e.view;
        
this.view.bind('show', this.show.bind(this));
this.view.bind('hide', this.hide.bind(this));
        
kendo.bind(this.elm, this.data, kendo.mobile.ui);
};

For some reason click events are being fired twice.
Petyo
Telerik team
 answered on 17 Jul 2013
1 answer
116 views
Using the layout template where I have the following markup

<div data-role="navbar">
    <a class="nav-button" data-align="left" data-transition="slide:left" data-role="backbutton">Back</a>
    <span data-role="view-title"></span>
    <a data-align="right" data-role="button" data-transition="slide:left" class="nav-button" href="#tabstrip-home">Home</a>
</div>
if you select the back button the first time the page loads you get Uncaught TypeError: Cannot call method 'split' of undefined - I guess as there is nothign to go back to, how can I disable this button until there is something to go back to?
Petyo
Telerik team
 answered on 17 Jul 2013
3 answers
211 views
Hi,

We're trialing Kendo UI Mobile for an iOS app targeted for the iPad. The pane navigation in the SplitView doesn't seem to be working. Navigating within the same view works but links with the target set to the other pane don't work. There are no errors in the console.

Tried with v2013.2.626 and v2013.1.514, also using jQuery 1.9.1 and RequireJS. The online demo works in the browser but not in the contained app. Please advise. Thanks

<div data-role="splitview">
     
    <div data-role="pane" id="side-pane" data-layout="side-default">
         
        <div data-role="view" data-title="Level 1" id="menu-root">
            <ul data-role="listview">
                <li><a href="#menu-sub" >Sub Menu</a></li>
            </ul>
        </div>
         
        <div data-role="view" data-title="Level 2" id="menu-sub">
            <ul data-role="listview">
                <li><a href="#test" data-target="main-pane">Test</a></li>
                <li><a href="#messages" data-target="main-pane">Messages</a></li>
            </ul>
        </div>
         
        <div data-role="layout" data-id="side-default" >
            <div data-role="header">
                <div data-role="navbar">
                    <span data-role="view-title"></span>
                </div>
            </div>
        </div>
         
    </div>
     
 
     
    <div data-role="pane" data-layout="main-default" id="main-pane">
         
        <div data-role="view" data-title="Test" id="test">
            <p>Test!</p>
            <a href="#messages" data-role="button">Go To Messages</a>
        </div>
         
        <div data-role="view" data-title="Messages" id="messages">
            <p>Messages!</p>
        </div>
         
        <div data-role="layout" data-id="main-default">
            <div data-role="header">
                <div data-role="navbar">
                    <span data-role="view-title"></span>
                </div>
            </div>
        </div>
    </div>
     
</div>
Petyo
Telerik team
 answered on 17 Jul 2013
2 answers
342 views
I am using the 2013.1.514 build of kendo dataviz and was wondering if there a way to disable the hover over/click event on the chart's legend area as I don't require this functionality.

Thanks

Chris




Chris
Top achievements
Rank 1
 answered on 17 Jul 2013
1 answer
97 views
I have a list of Customer objects in my Model that appear in as a simple grid.

I need to be able to let the user select various customers then press our "Process Selected Customers" button.

Does the grid provide a select check box option for rows so that I can then get a list of the customers the user selected?

Note: It "Must" have check boxes, that's a requirement I have been given.
Dimiter Madjarov
Telerik team
 answered on 17 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?