Telerik Forums
Kendo UI for jQuery Forum
1 answer
154 views

Find below a very simplified example derived from an application I'm currently developing.  In the real application the data source comes from an AJAX RESTFUL service call, but I have no issues with that part of the code.

The editor function on the ApplicationLogLevel works correctly from a pure editing point of view.  When I click on the cell the kendoDropDownList default selection is bound to the cell current value and if I change the current value the cell is updated with the appropriate new value and marked as changed.

What I want to do though, is instead of having the cell's actual numeric value displayed I want the cell to display the default selection from the kendoDropDownList when initially loading the cells contents into the grid.  If the value is changed then the default selection of the kendoDropDown should be re-bound to the newly selected value and then displayed with the new selection shown within the cell.

What would be the best way to accomplish this task?

<body>
<div id="grid"></div>
    <script type="text/javascript">
 
        var simpleAvailableLevels = [{text: "Level -1 = Undefined", value: "-1"},
                                                      {text: "Level  0 = No Logging", value: "0"},
                                                      {text: "Level  1 = Critical", value: "1"},
                                                      {text: "Level  2 = Error", value: "2"},
                                                      {text: "Level  4 = Warning", value: "4"},
                                                      {text: "Level  8 = Informational", value: "8"},
                                                      {text: "Level 16 = Verbose", value: "16"}];

        var simpleDS = [{ "ApplicationLogLevel": -1, "ApplicationName": "AjaxServer.java", "ConfiguredLogLevel": -1, "CreatedDate": "2012-08-01T10:24:33", "IsActive": false, "IsSecure": false, "MachineName": "Host 1", "ModifiedBy": null },
                                       { "ApplicationLogLevel": 8,  "ApplicationName": "AjaxServer.java", "ConfiguredLogLevel": -1, "CreatedDate": "2012-08-01T10:24:33", "IsActive": true,  "IsSecure": false, "MachineName": "Host 2", "ModifiedBy": null },
                                       { "ApplicationLogLevel": 8,  "ApplicationName": "AjaxServer.java", "ConfiguredLogLevel": -1, "CreatedDate": "2012-08-09T15:07:20", "IsActive": true,  "IsSecure": false, "MachineName": "Host 3", "ModifiedBy": null },
                                       { "ApplicationLogLevel": 16, "ApplicationName": "AjaxServer.java", "ConfiguredLogLevel": -1, "CreatedDate": "2012-08-03T11:04:05", "IsActive": true,  "IsSecure": false, "MachineName": "Host 4", "ModifiedBy": null}];

        $(document).ready(function () {
            $("#grid").kendoGrid({
                dataSource: simpleDS,
                columns: [{
                    width: 150,
                    field: "ApplicationName",
                    title: "Application Name"
                }, {
                    width: 150,
                    field: "MachineName",
                    title: "Host Name"
                }, {
                    width: 100,
                    field: "IsActive",
                    title: "Active"
                }, {
                    width: 125,
                    field: "ApplicationLogLevel",
                    title: "Current Log Level",
                    editor: function (container, options) {
                        $('<input name="' + options.field + '"/>')
                      .appendTo(container)
                      .kendoDropDownList({
                          value: options.field,
                          dataTextField: "text",
                          dataValueField: "value",
                          dataSource: simpleAvailableLevels
                      });
                    },
                    editable: "inline"
                }, {
                    width: 100,
                    field: "ModifiedBy",
                    title: "Modified By",
                    nullable: true
                }],
                sortable: {
                    mode: "multiple",
                    allowUnsort: true
                },
                pageable: {
                    pageSizes: [10, 25, 50]
                },
                editable: { update: true },
                toolbar: [{ name: "save", text: "Save These Record" },
                              { name: "cancel", text: "Cancel"}]
            });
        });
    </script>
</body>

Allan
Top achievements
Rank 1
 answered on 24 Aug 2012
0 answers
36 views
I have a viewModel model that has the following type characteristics:

Broker: "",  
BondProceeds: function(){                                       
           return this.get("UnderlyingPar") * (this.get("UnderlyingPrice")/100) + this.get("UpfrontFees");
                                        },

When I submit using Create on a datasource Broker will get sent but not BondProceeds. I suspect because there is a function. How do you work around this?
axwack
Top achievements
Rank 1
 asked on 24 Aug 2012
2 answers
365 views
I have a pretty simple grid

var element = $("#grid").kendoGrid({
          dataSource: {       
                      pageSize: 10,
                                   type: "json",                                     
                                    transport: {
                                        read: {
                                            url: queryurl,
                                            dataType: "json"
                                        }
                                    },
                                    schema: {
                                        data: "data",
                                        total: "total"
                                    }
                                },
                                detailInit: detailInit,
                                selectable: true,
                                sortable: true,
                                filterable: true,
                                columnMenu: true,                               
                                columns: [ {
                                        field: "PackageID",
                                        width: 90,
                                        title: "Package ID"
                                    } , {
                                        width: 50,
                                        field: "Installations",
                                        title: "Installations"                                       
                                    } , {
                                        field: "InstalledPackage",
                                        width: 100,
                                        title: "Installed Package"
                                    } , {
                                        width: 100,
                                        field: "ApplicationName",
                                        title: "Application Name"
                                    } , {
                                        width: 100,
                                        field: "Windows7Certified",
                                        title: "Win7 Certified"
                                    } , {
                                        width: 120,
                                        field: "RecommendedVersion",
                                        title: "Recommended Version"
                                    }
                                ],
                                pageable: {
                                    numeric: true,
                                    previousNext: true,
                                    refresh: true,
                                    pageSizes: [ 10 , 25, 50 ]
                                },
                            });
                        }
                    }).data("kendoComboBox");

works well however I am confused about the pager bar

even the most basic grid in the demos show more information than mine.
all I see are the page numbers themselves and the ellipse to indicate more than 10 pages

I have tried setting the messages: but that doesn't work either

How can I get the prevnext page x of x  totals rows etc... to show? like...

pageable: {
    numeric: true,
    refresh: true,
    pageSizes: [ 10 , 25, 50 ],
    previousNext: true,
    input: true,
    info:true
},

David OBrien
Top achievements
Rank 1
 answered on 24 Aug 2012
1 answer
192 views
I'm trying to use a stacked bar chart and need to change the width of the bars to match other elements on the page, I have it pretty close just by changing the size of the chart but if I make it any smaller, the labels wont display correctly. Is there anyway to set bar/column widths? Thanks!

Edit: Added a photo of what I'm talking about, changing the height of the chart got the bars to the width they are at now, which worked out because it made the labels match the spacing of the rest of the page. If I go any smaller on the height of the chart then the labels start stacking on top of each other. Is there any way to make the bars that thin?
Cody
Top achievements
Rank 1
 answered on 24 Aug 2012
1 answer
93 views
Hi

adding an Editor to a tabstrip does not work in ie9, but works in chrome 21.0.1180.79 m and in firefox 14.0.1.

In ie9 the text area of the Editor does not have the correct height. 

Attached a sample html document.

Is there any work around for this issue? 

Thanks

Frank

Petur Subev
Telerik team
 answered on 24 Aug 2012
2 answers
729 views
Hi,

I written the following line to upload images.

<div style="width: 45%">
        <input name="files" id="files" type="file" />
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#files").closest(".k-upload").find("span").css("width", "300px");
            $("#files").kendoUpload({
                localization: {
                    "select": "Upload New Image",
                    "cancel": "Cancel",
                    "retry": "Retry",
                    "remove": "Remove",
                    "uploadSelectedFiles": "Upload files",
                    "dropFilesHere": "drop files here to upload",
                    "statusUploading": "uploading",
                    "statusUploaded": "uploaded",
                    "statusFailed": "failed"
                },
                async: {
                    saveUrl: "here what?",
                    removeUrl: "remove",
                    autoUpload: true
                }
            });
       });
            
    </script>

I  have  two questions

1. can you explain about saveUrl? How to save a selected image in specified local drive folder?
2. How to show a selected image in img tag?

i couldn't find any example from download kit kendoui.complete.2012.1.515.trial
can any one please help about this kendo  upload

Thanks for you assistance
T. Tsonev
Telerik team
 answered on 24 Aug 2012
1 answer
96 views
Hi Kendo Support,

We are already Telerik customers and satisfied with the support.

We are trying out Kendo UI and really excited about the Grids performance.

However there is one feature that I cannot find in Kendo Grids which is the Exporting feature. We really need this feature or any alternative solution.
I have checked some samples in the Code Library that will not work for my case because they are written for MVC project and not for ASP .NET AJAX project.

Please let me know how can I export the filtered data to PDF format in a Kendo Grid using ASP .NET AJAX.

Your help is highly appreciated.

Thanks,
Bilal Ghalayini
Dimo
Telerik team
 answered on 24 Aug 2012
0 answers
76 views
I have a kendo datasource with columns Qty and Price. After datasource read data from remote WCF service, I want to add new a column to datasource which hold my calculation result ie, Qty*Price? How to do using jQuery?
Navin
Top achievements
Rank 1
 asked on 24 Aug 2012
0 answers
63 views
I want to compare a column (QtyReceived) to another column (QtyShipped) and change the font color and size and format of the QtyReceived column if it is less than QtyShipped. I need to be able to do the compare when the kendo datasource is first read. I am using JQuery Framework only.
Navin
Top achievements
Rank 1
 asked on 24 Aug 2012
2 answers
103 views
I'm stuck!
My data looks something like this:
{
    "@type":"object",
    "expand":{"@type":"string","#text":"editmeta,
    "key":{"@type":"string","#text":"10005"}
}
 
and I'm trying to bind the key['#text'] field to a column in my grid as:
$("#grid").kendoGrid({
    columns: [
        {
            field: "key",
            title: "key",
        }
    ],
    dataSource: {
        data: data.issues.item,
        pageSize: 10
    },
    selectable: true,
    pageable: true,
});
 
The sample above only returns "{object Object}", which I expected, but I can't figure out how to get the #text field ;) I've tried defining a schema with the source and I've also used "key[\"#text\"] without any success...

Thanks
Mikael
Mikael
Top achievements
Rank 1
 answered on 24 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?