Telerik Forums
Kendo UI for jQuery Forum
5 answers
1.4K+ views
$(document).ready(function ()
  {
  $("#adminGrid").kendoGrid({
  dataSource:dataSource,
  toolbar: ["create"],
   columns: [
    { field: "name", title: "Name", width: "150px" },
    { field: "description", title:"Description", width: "150px" },
    { field: "logo", title:"Logo", width: "150px" },
    { field: "startDate", title:"Start Date", width: "150px", format:"{0:MM/dd/yyyy}" },
    { field: "endDate", title:"End Date", width: "150px", format:"{0:MM/dd/yyyy}"},
    { field: "disabled", title:"Disabled", width: "50px" },
    { command: { text: "Edit Tags", click:showTags }, title: " ", width: "110px" }],
    editable: "inline"
             });
              
         //  $("#mainDiv").on("click",".h-edit-tags", showAlert);
  });
         
function showAlert(e)
{
  e.preventDefault();
  alert("hello");
}

The click event defined in my Grid's custom button never fires when I click my custom button... what am I doing wrong?
If I assign a class to the custom button and us the jquery on function everything fires just fine.
Mike
Top achievements
Rank 1
 answered on 25 Jul 2012
1 answer
255 views
Hello, I've got a listview whose template includes a button that causes removal of the clicked item from the listview.  I also followed another forum post explaining how to suppress the mouseclick event so that my button click event doesn't select the clicked item. 

However, when the remove happens in my click handler via the listview.remove(item) method, it looks like the listview syncs to the datasource.  The problem is that when this occurs the listview appears to lose it's selection.  I'm guessing this is by design, but is there a way in which I can store the selected index before the remove and then reselect the item afterwards?  The main task is getting the selected index in my click handler.  I see a way to get the selected item using listView().select() but not the index.  After the rebind, if I try to pass this selected item into the select function it no longer finds it, so I guess it goes out of scope after the rebind. 

Do you have any guidance for me?

Thanks,
Eric
Eric
Top achievements
Rank 1
 answered on 24 Jul 2012
1 answer
47 views
This is one of those cases that surprised me because Internet Explorer actually displays correctly and it's Firefox and Chrome that are screwed up...go figure!

In the series label and tooltip label, I have defined a template. Using a <br /> to create a line break in the template causes the labels to be completely blank in Firefox and Chrome, however, they display fine in Internet Explorer. I'm not sure if this is a bug or if there is a different way to generate a line break in a label, but I could use some assistance figuring it out.

Thanks.
Iliana Dyankova
Telerik team
 answered on 24 Jul 2012
2 answers
107 views
Kendos,

I'm writing a fairly complex app using the framework. The app uses a page input form with many complex elements. This page is fetched via ajax using the application navigate methods.

The issue is that this appends the main document. So each time you call a slightly different version of this page (edit, etc) it fetches the HTML via Ajax and appends it to the current document.

This not only vastly increases the size of the document (and possibly leading to memory issues if the app is open for long enough) but also it confuses the DOM as there are now 2 or more versions of the form, so you get 2 or more copies of ID elements.

I'd like a way to 'clean up' all previously loaded views when fetching a new page. I've managed to fudge this in my code by putting this in the data-init function of the form I'm loading:

$('div[data-role=view]').each( function( i, elem )
            {
                if ( $(elem).attr('data-url') && $(elem).attr('data-url') != window.location.hash.replace( /#/, '' ) )
                {
                    $(elem).remove();
                }
            } );

But it seems less that optimal and prone to bugs down the road.

Something to consider for a future version?
Jonathan
Top achievements
Rank 1
 answered on 24 Jul 2012
5 answers
287 views
How can I get the line chart to accept JSON with this format?

{
    "apps": [
        { "Name": "One", "Data": [8, 4, 10, 15, 6, 2, 7, 12, 10, 11, 5, 9] },
        { "Name": "Two", "Data": [7, 17, 9, 10, 7, 5, 15, 16, 7, 16, 5, 1] },
        { "Name": "Three", "Data": [18, 9, 8, 17, 13, 3, 11, 3, 8, 1, 5, 2] },
        { "Name": "Four", "Data": [5, 19, 7, 13, 8, 5, 19, 11, 2, 3, 16, 1] },
        { "Name": "Five", "Data": [5, 5, 9, 4, 14, 11, 5, 17, 6, 15, 14, 7] }, 
        { "Name": "Six", "Data": [13, 17, 18, 4, 19, 0, 8, 11, 2, 4, 9, 13] }
    ],
    "labels": [ "0:00", "1:00", "2:00", "3:00", "4:00", "5:00", "6:00", "7:00", "8:00", "9:00", "10:00", "11:00" ]
}

I'm not seeing how to transform the data from what I've got to what the Kendo line chart accepts. In fact, I don't really see any documentation on what the Kendo charts accept for data other than a demo that doesn't actually show the format of the data (I had to figure out the url to the JSON datasource).

I do have something working in jsfiddle (http://jsfiddle.net/472Xr/2/), but that doesn't seem like a workable solution for a remote data source that can be updated on the client.
Mike
Top achievements
Rank 1
 answered on 24 Jul 2012
0 answers
123 views
Hi, 
I want find and select a Node in TreeView with HierarchicalDataSource.
I have create a webService for to find the Item and the path in tree.
I want expand the treeview for show the Find Node.
How ?
The FindByText and expand not fuction ?

Help me.
Vitantonio
Top achievements
Rank 1
 asked on 24 Jul 2012
5 answers
341 views
i don't want to display grid if no record found here is my code i use the change function to check if data length exist  then grid display but it's no working and browser give me an error with the two options "Continue","Stop Script"..here is my code

var DataSource, UserName;

$(function () {

    UserName = $('#NameText').val();

    GetDataSource();
   
});


function GetDataSource() {

    DataSource = new kendo.data.DataSource({
        pageSize: 10,
        change: function () {
            if (this.data().length) {
              CreateGrid();
            }
        },
        transport: {
            read: {
                type: "POST",
                url: "/WebBasedBookExchangeSystem/books.svc/GetUserBooks",
                contentType: "application/json; charset=utf-8",
                dataType: "json"
            },
            update: {
                type: "POST",
                url: "/WebBasedBookExchangeSystem/books.svc/UpdateUserBook",
                contentType: "application/json; charset=utf-8",
                dataType: "json"
            },
            destroy: {
                type: "POST",
                url: "/WebBasedBookExchangeSystem/books.svc/DeleteUserBook",
                contentType: "application/json; charset=utf-8",
                dataType: "json"
            },
            parameterMap: function (data, operation) {

                if (operation == "update")
                    return kendo.stringify({ updateBook: data });
                else if (operation == "destroy")
                    return kendo.stringify({ deleteBook: data });
                else if (operation == "read")
                    return kendo.stringify({ user: UserName });

            }
        },

        schema: {

            parse: function (data) {
                return JSON.parse(data.d);

            },
            model: {
                id: "Book_Id",
                fields: {
                    "Book_Id": { type: "number" },
                    "Title": { type: "string" },
                    "ISBN": { type: "string" },
                    "Author": { type: "string" },
                    "Price": { type: "number" }
                }
            }
        }
    });

    DataSource.read();
}

function CreateGrid() {

    $('#grid').kendoGrid({

        filterable: true,
        sortable: true,
        pageable: true,
        scrollable: false,
        editable: "popup",
        columns: [
                    { field: "ISBN", filterable: false, width: 50, title: "ISBN NO" },
                    { field: "Title", title: "Book Title", width: 180 },
                    { field: "Author", filterable: false, width: 180, title: "Book Author" },
                    { field: "Price", filterable: false, width: 50, title: "Price (Rs)" },
                    { command: ["edit", "destroy"], title: "Action", width: 5 }
                 ],

        dataSource: DataSource

    });
}
Michael
Top achievements
Rank 2
 answered on 24 Jul 2012
0 answers
121 views
I have an XML RPC server which has a method to return data from a database when it is called. I want to bind a datasource to this method so that I can use this data in a grid. However, I haven't been able to find an example which shows this sort of thing. Is this possible, and if so could someone point me in the direction of an example? The POST request which I can send to the server to access the method looks like this:

<?xml version="1.0"?>
<methodCall>
<methodName>breq.getBreqs</methodName>
<params>></params>
</methodCall>
Paul
Top achievements
Rank 1
 asked on 24 Jul 2012
1 answer
157 views
why there are no :
1. "kendo-radioButtonList" 
2. "kendo-checkBoxList" 
3. "kendo-radioButton"
4. "kendo-checkBox"

if there are, the form elements will have universal theme(look and feel) !!!
Vesselin Obreshkov
Top achievements
Rank 2
 answered on 24 Jul 2012
3 answers
344 views
I want to use the visible and editable bindings in a complex, nested form. it consists of tabs, with <fieldsets> as child elements. the fieldsets itself host the individual form fields (e.g. <input>,<select>). what i want to is to apply visible or enable bindings to entire fieldsets or tabs. If the enable property is set on a tab, it should still be possible to open it, but all form fields on it should be disabled.

any idea how i could accomplish this with kendoui mvvm? i'm aware that i might have to write my own custom mvvm binders for that, since the enable binding is limited to form fields.

kind regards,

Franz
Atanas Korchev
Telerik team
 answered on 24 Jul 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?