two different values

3 posts, 1 answers
  1. Answer
    sven avatar
    2 posts
    Member since:
    Apr 2013

    Posted 26 Apr 2013 Link to this post

    Hello, it is possible to selectively retrieve two different values​​? A name or number? e.g. John Doo = text value and 123 = number value

            "CustomerID": "ALFKI",
            "ContactName": "Maria Anders", // selectively 
            "PersonalNumber": "1234", // selectively 
            "CompanyName": "Alfreds Futterkiste"

    EDIT: I'm looking for a solution if I type a number eg. "12" in 1234 suggested I get when I type "Ma" I inspire get the same user suggested ... It's possible??
                dataTextField: "PersonalNumber",
                dataValueField: "CustomerID",
                dataNumberField: "PersonalNumber",
                // define custom template
                itemTemplate: '<img src=\"../content/web/Customers/${data.CustomerID}.jpg\" alt=\"${data.PersonalNumber}\" />' +
                        '<h3>${ data.ContactName }</h3>' +
                        '<p>${ data.CompanyName }</p>'+
                        '<p>${ data.PersonalNumber }</p>',
                tagTemplate: '<img class="tag-image" src=\"../content/web/Customers/${data.CustomerID}.jpg\" alt=\"${data.CustomerID}\" />' +
                        '#: data.ContactName #',
                dataSource: {
                    //serverFiltering: true,
                    transport: {
                        read: {
                            dataType: "json",
                            url: "customers.json"
                maxSelectedItems: 5,
                height: 300
  2. Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 30 Apr 2013 Link to this post

    Hello Sven,

    I am afraid this is not supported. The suggestion are always working over the dataTextField field specified.

    You can change your model to contain a composite field

            "CustomerID": "ALFKI",
            "ContactName": "Maria Anders", // selectively
            "PersonalNumber": "1234", // selectively
            "CompositeField": "Maria Anders 1234"
            "CompanyName": "Alfreds Futterkiste"

    use that field as a dataTextField. 

    Then change the filter type from "startswith" to "contains". 

    Kind Regards,
    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. sven
    sven avatar
    2 posts
    Member since:
    Apr 2013

    Posted 30 Apr 2013 Link to this post

    it works, Thanx :)
Back to Top