Telerik Forums
Kendo UI for jQuery Forum
2 answers
210 views
Hello! I am new kendo ui and i am developing a mobile web application for an institute. At first stage, I want to show all the courses which contains 5 columns(eg name, details...). My question is how can I return these data to data reader and bind to listview?

Thanking you in advance!
Dhananjay
Top achievements
Rank 1
 answered on 18 Jun 2012
0 answers
312 views
Hi,

I am trying to create a ListView of items. I am trying to make it such that when a user clicks on the "rowdelete" detail button, that particular row gets updated or deleted in the dataSource, and the ListView gets synced to that.

I declare my list view with a template like this:

<ul id="flat-listview" style="font-size: .8em"></ul>
<script type="text/x-kendo-template" id="customListViewTemplate">
${name}: ${qty}<a data-role="detailbutton" data-style="rowdelete" data-click="deleteItem"></a>
</script>

The functions to refresh the ListView and add items to it are as follows:
<script>
function reinitListView() {
$("#flat-listview").kendoMobileListView({ 
dataSource: kendo.data.DataSource.create({data: dataList}), 
template: $("#customListViewTemplate").html(),
});
}

function addToList(item) {
for (var i = 0; i < dataList.length; i++) {

if (dataList[i].name == item) {
dataList[i].qty++;
reinitListView();
return;
}
}
dr = new Object();
dr.name = item;
dr.qty = 1;
dataList.push(dr);
reinitListView();
}
</script>

I tried writing a function called deleteItem (called when the button is clicked), but I don't know how to access the list view row from there. 
Sherry
Top achievements
Rank 1
 asked on 18 Jun 2012
1 answer
127 views
Hello, Its been week and still no luck on dropdown and finally I'm throwing up my towel. I hope you can help me on this.


          
         var lastNameData =[{"lastName":"White","lastNameID":0},{"lastName":"Great","lastNameID":1}];
          
               var lastNameDataSource = new kendo.data.DataSource({
        data: lastNameData,
            schema: {
            model: {
                id: "lastNameID"
            }
        }
    });
             
             
             
          
          
         function lastNameDropDownEditor(container, options) {
                         
                  $('<input data-bind="value:' + options.field + '"/>')
    .appendTo(container)
    .kendoComboBox({
         autoBind: false,
        dataTextField: "lastName",
        dataValueField: "lastName",
        dataSource: lastNameDataSource
    });
                }
          
var blankData;
                $(document).ready(function () {
                    var dataSource = new kendo.data.DataSource({
                         
                                parameterMap: function(options, operation) {
         
        //alert(operation);
                                    if (operation !== "read" && options.models) {
                                        return {models: kendo.stringify(options.models)};
                                    }
                                   
                                    },
                 
                transport: {
                     
         read: {
dataType: "json",
 type: "POST",
data: {"SQLCMD":"SELECT * FROM gridTest","Table":["firstName","nickName","lastName"],"PrimaryKey":"peopleID"}
},
         update: {
            type: "POST"
         },
         destroy: {
             type: "POST"
          },
          create: {
              type: "POST",
               data: {
                req: ["firstName","nickName"]                }
               
               
           }
         },
                
         // determines if changes will be send to the server individually or as batch
         batch: false,
         //...
 
 
                       pageSize: 30,
                       data: blankData,
                       autoSync: true,
                       schema: {
                           model: {
                             id: "peopleID",
                             fields:
                                {"peopleID":{"editable":false,"nullable":true},"firstName":{"type":"string","validation":{"required":true},"nullable":false,"defaultValue":""},"nickName":{"type":"string","validation":{"required":true},"nullable":false,"defaultValue":""},"lastName":"lastName"}                             }
                           ,  parse: function (data) {
        // alert(data);
            return data;
        }
                       }
                    });
 
                    $("#grid").kendoGrid({
                        dataSource: dataSource,
                        pageable: true,
                        height: 340,
                        toolbar: ["create"],
                        columns:
                            [{"field":"firstName","title":"First name"},{"field":"nickName","title":"Nick Name"},{"field":"lastName","width":"150px","editor":"lastNameDropDownEditor"},{"command":"destroy","title":" ","width":"110px"}]                            ,
                             
                        editable: true
                    });
                });


Please help! thanks!
Mike
Top achievements
Rank 1
 answered on 17 Jun 2012
0 answers
93 views
I would like clicking on a selected node to do the same thing as clicking on an unselected node.
Triggering the "select" event even it its selected would be fine but any other solution
to trigger SOME event if the node is already selected is fine too.
Christopher
Top achievements
Rank 1
 asked on 16 Jun 2012
0 answers
462 views
I added a datepicker control to a grid for edit mode. When the updates, it displays a long format time string. I would like to format the time as a short date string, but I have not found the event to delegate. The code below demonstrates the problem:

            <div id="grid"></div>

            <script language="javascript" type="text/javascript" >

                $(document).ready(function ()
                {

                    $("#grid").kendoGrid({
                        dataSource:
                        {
                            data:
                            [
                                {Employee:"Joe Jones",Dept:"Sales",Job:"Account manager",DateVal:"1/2/2012"},
                                {Employee:"Samantha Smith",Dept:"Marketing",Job:"Design",DateVal:"2/3/2012"}
                            ]
                        },
                        pageable: true,
                        height: 455,
                        filterable: true,
                        sortable: true,
                        scrollable: { virtual: false },
                        selectable: 'row',
                        columns: [
                            { field: "Employee", title: "Employee" },
                            { field: "Dept", title: "Department" },
                            { field: "Job", title: "Job" },
                            {
                                field: "DateVal",
                                title: "Date Hired",
                                editor: function (container, options)
                                {
                                    $('<input id=\"' + options.field + '\" />').appendTo(container)
                                    .kendoDatePicker({ format: "MM/dd/yyyy" });

                                    var datePicker = $("#DateVal").data("kendoDatePicker");
                                    // bind to the close event
                                    datePicker.bind('close', function (e)
                                    {
                                        var datepicker = e.sender.element.kendoDatePicker()
                                        var d = new Date(datepicker.val());
                                    });

                                }
                            },
                            { filterable: false, command: ["edit"], title: "&nbsp;", width: "210px"}],
                        editable: "inline"
                    });

                });

</script>

Click "Edit", then a date from the datepicker control, then look at the resulting time string in the grid.
Sorry if I posted this in the wrong forum before.
John
Top achievements
Rank 1
 asked on 15 Jun 2012
0 answers
62 views

I created a datepicker column in the grid for edit mode. It works, but when the grid gets the date from the datepicker, the time string is in long format. I would like to be able to change this to a short date, but I have not been able to determine how to intercept the update. Past the code below into a page to see what happens. How can I change the date format in the grid to show a short date after editing? Thanks.

           <div id="grid"></div>

            <script language="javascript" type="text/javascript" >

                $(document).ready(function ()
                {

                    $("#grid").kendoGrid({
                        dataSource:
                        {
                            data:
                            [
                                {Employee:"Joe Jones",Dept:"Sales",Job:"Account manager",DateVal:"1/2/2012"},
                                {Employee:"Samantha Smith",Dept:"Marketing",Job:"Design",DateVal:"2/3/2012"}
                            ]
                        },
                        pageable: true,
                        height: 455,
                        filterable: true,
                        sortable: true,
                        scrollable: { virtual: false },
                        selectable: 'row',
                        columns: [
                            { field: "Employee", title: "Employee" },
                            { field: "Dept", title: "Department" },
                            { field: "Job", title: "Job" },
                            {
                                field: "DateVal",
                                title: "Date Hired",
                                editor: function (container, options)
                                {
                                    $('<input id=\"' + options.field + '\" />').appendTo(container)
                                    .kendoDatePicker({ format: "MM/dd/yyyy" });

                                    var datePicker = $("#DateVal").data("kendoDatePicker");
                                    // bind to the close event
                                    datePicker.bind('close', function (e)
                                    {
                                       // See what the datepicker is returning:
                                        var datepicker = e.sender.element.kendoDatePicker()
                                        var d = new Date(datepicker.val());
                                    });

                                }
                            },
                            { filterable: false, command: ["edit"], title: "&nbsp;", width: "210px"}],
                        editable: "inline"
                    });

                });
</script>

John
Top achievements
Rank 1
 asked on 15 Jun 2012
4 answers
122 views
First I want to say I really like kendo so far in my testing, great job!
I couldn't find a more appropriate place to post this so here goes.

Due to the newness of kendo, I am finding myself searching your forums for people with similar problems often.
Is it just me or is it very difficult to navigate?

There is a search option top of page but it searches every category of every forum, blog, doc and video... kind of hard to sift through unless I am missing some kind of option to narrow it down... I see the option to narrow to forums only but you still get 6 per page of tons and tons of matches.

Go into the grid forum and search for "filters" and you get    1 – 6 of 421 results    basically at that point I say forget it :).  I would suggest maybe consider tags or groups, like if I posted about grid filters, I would tag it about "filters", maybe a multiple choice of available topics from the api to choose from?? That way you click on forums>grid>filters and you get probably 25 results not 421... just offering feedback and suggestions.

Seems like every other dev package you guys offer like wpf and asp.net and others have separated searchable documentation and forums but kendo is completely different and more difficult and lacking documentation imho?
Dr.YSG
Top achievements
Rank 2
 answered on 15 Jun 2012
1 answer
97 views
We're currently using Telerik controls for ASP.NET AJAX.

In our application, we have a grid that addresses certain part numbers that have 2 related rows.  They are grouped together in the grid, and it looks as below:
____________________________
|Part Number   |HasProperty  |Price |
----------------------------------------------
                |             Yes           |  1.00 |
Part #1    |  --------------------------------
               |               No            |   2.00 |
------------------------------------------------

Is this type of this possible with the Kendo UI grid?
Iliana Dyankova
Telerik team
 answered on 15 Jun 2012
0 answers
82 views
Does the Grid not have a default for an emopty datasource - I was expecting it to say something like no results found.
Gregor
Top achievements
Rank 1
 asked on 15 Jun 2012
2 answers
379 views
I have the following dataSource that I retrieve from a json file:
[
    {
    "Name": "Company 1",
    "People": [{
        "Person": {
            "Name": "Jon",
            "Job": "IT Guy"
        }},
    {
        "Person": {
            "Name": "Kate",
            "Job": "Web Developeresse"
        }}]},
{
    "Name": "Company 2",
    "People": [{
        "Person": {
            "Name": "Jane",
            "Job": "IT Girl"
        }},
    {
        "Person": {
            "Name": "Karl",
            "Job": "Web Developer"
        }}]}
]

My goal:

Display a list of companies' names in a mobile list view.
When you select a company, it should change views and display a mobile list view of the selected company's people's names.

I can get the first list view to show up and on the click event I can navigate to a new view. How should I approach the second list view? 

Can I use a view model to do this? Can you bind the mobile list view's dataSource to the viewModel? 

I've created this jsFiddle to ask whether this would be the correct method of doing this: http://jsfiddle.net/RodEsp/p9UQW/
RodEsp
Top achievements
Rank 2
 answered on 15 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?