Telerik Forums
Kendo UI for jQuery Forum
1 answer
113 views
Hello,
we use an alternative layout and editing of the list item.
$("#listView").kendoListView({
        pageable: true,
        selectable: 'single',
        navigatable: false,
        editable: true,
        dataSource: viewModel.dataSource,
        template: $("#customListViewTemplate").html(),
        altTemplate: $("#customListViewTemplateAlt").html(),
        editTemplate: $("#editTemplate").html()
    });
After editing or canceling the row with alt layout, the alternative layout disappears and is replaced with the default layout.

How can this be fixed?
Nikolay Rusev
Telerik team
 answered on 04 Dec 2012
1 answer
302 views
Hi we are trying to develop an mobile app using kendo ui. we need to integrate the chart controls in project.
The below code does the same but in chrome (on desktop) and opera(on android device). we need an .apk file so we tried to run this code in icenium simulator for android it doesn't work.

Plz help us with a solution.
<!DOCTYPE html >
<html  >
<head>
    <title></title>
 
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/kendo.all.min.js" type="text/javascript"></script>
 
    <link href="styles/kendo.mobile.all.min.css" rel="stylesheet" type="text/css" />
<style>
html,body
{
    width:100%;
}   
</style
</head>
<body>
 
 
 
 <div data-role="view" id="main"  data-layout="mobile-view" data-stretch="true"
 <div style="background-image:url('images/Green Stripy Wallpapers.jpg');">
    <a data-role="button" style="width:100%;">Button</a>
     
 
      <div id="example" class="k-content" style="width:100%; background:white;">
            <div>
                <div id="chart"  style="width:100%;"></div>
            </div>
        </div>
      </div>
    </div>
 
 
<script type="text/javascript">
    function createChart() {
        $("#chart").kendoChart({
            theme: $(document).data("kendoSkin") || "default",
            title: {
                text: "Internet Users"
            },
            legend: {
                position: "bottom"
            },
            chartArea: {
                background: ""
            },
            seriesDefaults: {
                type: "bar"
            },
            series: [{
                name: "World",
                data: [15.7, 16.7, 20, 23.5, 26.6]
            }, {
                name: "United States",
                data: [67.96, 68.93, 75, 74, 78]
}],
                valueAxis: {
                    labels: {
                        format: "{0}%"
                    }
                },
                categoryAxis: {
                    categories: [2005, 2006, 2007, 2008, 2009]
                },
                tooltip: {
                    visible: true,
                    format: "{0}%"
                }
            });
        }
 
        $(document).ready(function() {
        var app = new kendo.mobile.Application();
            setTimeout(function() {
                // Initialize the chart with a delay to make sure
                // the initial animation is visible
                createChart();
 
                $("#example").bind("kendo:skinChange", function(e) {
                    createChart();
                });
            }, 400);
        });
</script>
 
</body>
</html>
Iliana Dyankova
Telerik team
 answered on 04 Dec 2012
2 answers
423 views
This bug - about dropdownlist popup being opened under the window popup - I've seen before and it was fixed in the later release.
Still  - it's not fixed completely.
The bug reproduced when window is initialized with "appendTo" property set to form.
You can see it here: http://jsfiddle.net/ZM34e/

I don't think, you will fix it soon, as the new release is just came, but can you provide a workaround?
Elena
Top achievements
Rank 1
 answered on 04 Dec 2012
1 answer
247 views
Hi, I hope I use the correct terminology here but I went through the 5 part Kendo tutorial (Hello JQuery, Hello HTML5, Hello Kendo UI etc.) and IIUC this was centered around creating a Web API project which was used to create an MVVM patterned project which used regular WebForms and the Kendo scripts.
Now, if I choose 'New asp.net mvc 3 project' in VS I will obviously have a very different architecture to the MVVM described above.

Let's say I have no reason to use any specific pattern, which approach would you suggest to be the easiest and/or most suitable for Kendo UI?
Daniel
Telerik team
 answered on 04 Dec 2012
1 answer
138 views

With the Telerik KendoUI web Grid control, what are the requirements for us to get a value for filtering dates when using serverside filtering?

What we see when we filter on other columns - which is great, as we can easily parse this (strings for example) is:

filter[filters][0][field]

filter[filters][0][operator]

filter[filters][0][value]

filter[logic]

What we see when we filter on date columns is - there is no value to parse out here: (note: the value is missing for this date filter, but it was not missing in the string filter).

filter[filters][0][field]

filter[filters][0][operator]

filter[logic]

Additional information about how we are using the date column in our grid:

Initialized with this column as a date:

field: "LastUpdated", title: "Updated", format: "{0:MM/dd/yyyy}"

Datasource for this grid has this column as a date:

LastUpdated: { type: "date", nullable: true }


Thank you,

Chris

Rosen
Telerik team
 answered on 04 Dec 2012
3 answers
164 views
Here's my code,
<div id="example" class="k-content">
        <div id="tweets-container" class="k-header k-menu-vertical">
            <h3>
                Twitter feed</h3>
            <div id="search-box">
                <label>
                    Search for:
                    <input type="text" value="html5" id="searchfor" class="k-textbox" />
                </label>
                <button class="k-button" id="search">
                    search</button>
            </div>
            <div id="tweets">
                <div>
                    Loading ...
                </div>
            </div>
        </div>
        <script id="template" type="text/x-kendo-template">
                <div class="tweet k-header">
                    <img width="48" height="48" src="#= profile_image_url #" alt="#= from_user #" />
                    #= FirstVal #
                </div>
        </script>
        <script>
            $(document).ready(function () {
                // create a template using the above definition
                var template = kendo.template($("#template").html());
 
                var Product = kendo.data.Model.define({
                    id: "FirstID",
                    fields: {
                            "FirstVal": {
                            type: "string"
                            },
                            "SecondVal": {
                                type: "string"
                            }
                    }
                });
 
                var dataSource = new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: "/ws/getservice.asmx/GetAllTestimonials", // the remove service url
                            data: "{}",
                            contentType: "application/json; charset=utf-8",
                            dataType: "json", // JSONP (JSON with padding) is required for cross-domain AJAX
                            complete: function(data,xhr){
                                result = JSON.parse(data.d.resposeText);
                            }
                        }
                    },
                    change: function () { // subscribe to the CHANGE event of the data source
                        $("#tweets").html(kendo.render(template, dataSource.view()));
                    }
                });
 
                // read data from the remote service
                dataSource.read();
 
                $("#search").click(function () {
                    dataSource.read();
                });
 
                $("#searchfor").keydown(function (e) {
                    if (e.keyCode === kendo.keys.ENTER) {
                        dataSource.read();
                    }
                });
            });
        </script>
Here's my JSON
[{"FirstID":1,"FirstVal":"Test","SecondVal":"TestOne"},{"FirstID":2,"FirstVal":"Test","SecondVal":"TestTwo"}]
I'm not sure what I am doing wrong here, any help would be appreciated.
Atanas Korchev
Telerik team
 answered on 04 Dec 2012
7 answers
919 views
Combobox supports viewmodel binding to the "value" property as follows:
<input id="gradeCombo" data-role="combobox" data-bind="value: source.gradeValue"/>
Is there anyway to also bind to the "text" property, such as:
<input id="gradeCombo" data-role="combobox" data-bind="value: source.gradeValue, text: source.gradeText"/>
Trying to bind to the "text" property above fails.  So is there some other way to do this?  And where is the complete list of supported binding properties documented? 

Binding to the text is especially needed when using a remote datasource for the list of selections because:
1) you don't want to query the remote datasource (to find the text) unless the user interacts with the control
2) remote datasource is designed to query based on what user types in (i.e. text property) not the underlying value

Georgi Krustev
Telerik team
 answered on 04 Dec 2012
1 answer
299 views
Hi,
I have grid with 21 rows.my  requirement is to set some of  rows background color is Light Green(like 1,5,13 rows) and at the same time hide row values i.e i wanted to display rows with color and no data(plain row)..here is the code snifet...is this possible to achieve.please help out me

$("#gridSellIn").kendoGrid({
                                width: 1500,
                                dataSource: data.d,
                                resizable: true,
                                selectable: true,                                
                                rowTemplate: kendo.template($("#SellInrowTemplate").html()),
                                height: 500,
                                columns: [
                                                { title: 'RevProduct Name', field: 'ProductName', width: '22%', sortable: true },
                                                { title: 'Actuals MTD', field: 'MTDActual', width: '8%', sortable: true },
                                              
                                          ]
                            }); 

Thanks,
parsanamoni
Nikolay Rusev
Telerik team
 answered on 04 Dec 2012
3 answers
141 views

I have some working code which I am trying to convert to use the MVVM pattern. My code looks like the following:

To start with, I have a div tag like the following:

<div id="MyDiv" data-template="template" ></div>

My template looks like the following:

<script type="text/x-kendo-template" id="template">
        <table>
            <tr>
                <td>My Numbers: </td>
                #for (var i = 0; i < data.length; i++){#
                    <td><input type="text" value=#= data[i] # /></td>
                #}#
            </tr>
        </table>
</script>

Finally the following script provides data to the template:

<script>
    var rowTemplate = kendo.template($("#template").html());
    function display() {
        $("#MyDiv").html(rowTemplate({
            data: ["1.2", "2.3", "3.4"]
        }));
    }

    display();
</script>

When I run, the output shows the numbers 1.2, 2.3 and 3.4 in 3 inputboxes (each of which appears in 3 separate <td> tags) against a label, like the following:

My Numbers:     1.2     2.3     3.4

I have been trying to convert the above code to an MVVM pattern, but somewhy not getting it right. Could someone please guide me how to do this correctly?

Alexander Valchev
Telerik team
 answered on 04 Dec 2012
1 answer
222 views
Hello, just checking out the Kendo UI suite via different binding methods and coming across this issue. When binding via the client side, it appears the JSON data is being correctly passed to the grid, but the data is not displaying within the grid.

@(Html.Kendo().Grid(Model.Companies)   
    .Name("ClientBindGrid")
    .Columns(columns =>
    {
        columns.Bound(c => c.CompanyName);
        columns.Bound(c => c.State);
    })
    .Groupable()
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .ServerOperation(false) // paging, sorting, filtering and grouping will be applied client-side
        .Read(read => read.Action("GetCompanies", "ManageCompanies",  new { area = "api" }))
    )
)
And here is what you see in the generate HTML:
<div class="k-widget k-grid" id="ClientBindGrid"><div class="k-grouping-header">Drag a column header and drop it here to group by that column</div><div class="k-grid-header"><div class="k-grid-header-wrap"><table cellspacing="0"><colgroup><col /><col /></colgroup><tr><th class="k-header k-filterable" data-field="CompanyName" data-title="Company Name" scope="col"><a class="k-grid-filter"><span class="k-icon k-filter"></span></a><a class="k-link" href="http://localhost:2337/CompanyMgmt/ManageCompanies">Company Name</a></th><th class="k-header k-filterable" data-field="State" data-title="State" scope="col"><a class="k-grid-filter"><span class="k-icon k-filter"></span></a><a class="k-link" href="http://localhost:2337/CompanyMgmt/ManageCompanies">State</a></th></tr></table></div></div><div class="k-grid-content" style="height:200px"><table cellspacing="0"><colgroup><col /><col /></colgroup><tbody><tr><td>H&H</td><td>CO</td></tr><tr class="k-alt"><td>H&H3333</td><td>CO</td></tr></tbody></table></div><div class="k-pager-wrap k-grid-pager"><a class="k-link k-state-disabled" data-page="1" href="#" title="Go to the first page"><span class="k-icon k-i-seek-w">seek-w</span></a><a class="k-link k-state-disabled" data-page="0" href="#" title="Go to the previous page"><span class="k-icon k-i-arrow-w">arrow-w</span></a><ul class="k-pager-numbers k-reset"><li><span class="k-state-selected" data-page="1">1</span></li></ul><a class="k-link k-state-disabled" data-page="2" href="#" title="Go to the next page"><span class="k-icon k-i-arrow-e">arrow-e</span></a><a class="k-link k-state-disabled" data-page="1" href="#" title="Go to the last page"><span class="k-icon k-i-seek-e">seek-e</span></a><span class="k-pager-info k-label">1 - 2 of 2 items</span></div></div><script>
    jQuery(function(){jQuery("#ClientBindGrid").kendoGrid({"columns":[{"title":"Company Name","field":"CompanyName","encoded":true},{"title":"State","field":"State","encoded":true}],"groupable":{},"pageable":{"buttonCount":10},"sortable":true,"filterable":true,"dataSource":{"transport":{"read":{"url":""}},"pageSize":10,"page":1,"total":2,"type":"aspnetmvc-ajax","schema":{"data":"Data","total":"Total","errors":"Errors","model":{"fields":{"CompanyID":{"type":"number"},"CompanyName":{"type":"string"},"Address1":{"type":"string"},"Address2":{"type":"string"},"City":{"type":"string"},"State":{"type":"string"},"PostalCode":{"type":"string"},"ItemMargin":{"type":"number"},"ServicesMargin":{"type":"number"},"InvoiceTimeIncrement":{"type":"number"},"CashDiscountPct":{"type":"number"},"BaseServiceHourlyRate":{"type":"number"},"HourlyPremiumRush":{"type":"number"},"HourlyPremiumLate":{"type":"number"},"HourlyPremiumCustomerMaterial":{"type":"number"},"CreatedByID":{"type":"number"},"CreatedOn":{"type":"date"},"ModifiedBy":{"type":"number"},"ModifiedOn":{"type":"date"},"UserProfile":{"type":"object"},"UserProfile1":{"type":"object"},"FullAddress":{"editable":false,"type":"string"}}}},"data":{"Data":[{"CompanyID":2,"CompanyName":"H\u0026H","Address1":"123 Mockinbird Lane","Address2":null,"City":"Denver","State":"CO","PostalCode":"12345","ItemMargin":0,"ServicesMargin":0,"InvoiceTimeIncrement":0,"CashDiscountPct":0,"BaseServiceHourlyRate":0,"HourlyPremiumRush":0,"HourlyPremiumLate":0,"HourlyPremiumCustomerMaterial":0,"CreatedByID":0,"CreatedOn":"\/Date(-62135571600000)\/","ModifiedBy":0,"ModifiedOn":"\/Date(-62135571600000)\/","UserProfile":null,"UserProfile1":null,"FullAddress":"Denver, CO 12345"},{"CompanyID":3,"CompanyName":"H\u0026H3333","Address1":"123 Mockinbird Lane","Address2":null,"City":"Denver","State":"CO","PostalCode":"12345","ItemMargin":0,"ServicesMargin":0,"InvoiceTimeIncrement":0,"CashDiscountPct":0,"BaseServiceHourlyRate":0,"HourlyPremiumRush":0,"HourlyPremiumLate":0,"HourlyPremiumCustomerMaterial":0,"CreatedByID":0,"CreatedOn":"\/Date(-62135571600000)\/","ModifiedBy":0,"ModifiedOn":"\/Date(-62135571600000)\/","UserProfile":null,"UserProfile1":null,"FullAddress":"Denver, CO 12345"}],"Total":2}}});});
</script>
You can see the data is populated above, but the grid has no rows. So it seems this binding event is not being fired?
Rosen
Telerik team
 answered on 04 Dec 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?