Telerik Forums
Kendo UI for jQuery Forum
6 answers
441 views
The input renders out with required, then it gets the datepicker applied, then on click, the validation gets called

...am I doing something wrong with it?

**ignore "datepicker.PNG"** attached by accident, have a look at the other image
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 09 Sep 2012
1 answer
99 views
Hi, for create Large Web Applications, it's enough with Kendo, MVVM, DataSource, Template bindings, etc, 

or I need to also use any framework like Backbone or Knockout, Ember, or other?

What do You think about this?


Thanks.



IsmiKin
Top achievements
Rank 1
 answered on 09 Sep 2012
1 answer
183 views
Bottom line: How do I load items in a dropdown list from a different url after it's been initialized?

I have a 3 dropdown lists that are bound to 3 kendo data sources which read json from 3 different endpoints. I want to be able to select something from the first dropdown, and have the second and third dropdowns change. Just as an example, if the first dropdown is names of grandfathers, second dropdown is list of fathers and third dropdown is a list of sons, the third dropdown should only list sons related to the selected father, and the second dropdown should only list fathers related to the selected grandfather.

Cascading dropdowns aren't useful because I'm graphing data about grandfathers, fathers, and sons regardless of their relationships.

The endpoints are:
  1. "service/getGrandfatherList/"
  2. "service/getFatherList/grandfatherID"
  3. "service/getSonList/fatherID"
Problem is, I can't get the second and third dropdowns to change. In my onclose event handler I've tried:
  • $("fathers").data("kendoDropDownList").dataSource.read(); as suggested in this thread
  • Re-initializing the dropdown list, though that makes it disappear (see thread linked above)
  • Assigning the kendo data source to a new kendo.data.DataSource that reads from the appropriate URL then calling datasource.read(), datasource.fetch(),dropdownlist.refresh()
Those do nothing. What's weird is that even after assigning the data source to a new datasource and calling fetch(), it reads from the old url instead of the new one.

Hope I've explained this properly... any ideas?
Roderick
Top achievements
Rank 1
 answered on 09 Sep 2012
1 answer
223 views
Running Kendo UI 2012.2.710.340 in a MVC 4 .NET Web App.

When the page posts I get a java script error of
0x800a01b6 - Microsoft JScript runtime error: Object doesn't support this property or method

Rendered Java Script that is throwing the error
<div class="k-widget k-grid" id="gridDocumentType"><div class="k-toolbar k-grid-toolbar k-grid-top"><a class="k-button k-button-icontext k-grid-add" href="/DocumentType?gridDocumentType-mode=insert"><span class="k-icon k-add"></span>Add new item</a></div><div class="k-grid-header"><div class="k-grid-header-wrap"><table cellspacing="0"><colgroup><col /></colgroup><tr><th class="k-header k-filterable" data-field="Name" data-title="Name" scope="col"><a class="k-grid-filter"><span class="k-icon k-filter"></span></a><a class="k-link" href="/DocumentType?gridDocumentType-sort=Name-asc">Name</a></th></tr></table></div></div><div class="k-grid-content" style="height:200px"><table cellspacing="0"><colgroup><col /></colgroup><tbody><tr><td>Adoption Assistance</td></tr><tr class="k-alt"><td>CPS Child Fatality</td></tr><tr><td>CPS Non-Fatality</td></tr><tr class="k-alt"><td>CSA Case Manager</td></tr><tr><td>CWBC</td></tr><tr class="k-alt"><td>Education</td></tr><tr><td>Family</td></tr><tr class="k-alt"><td>Home County Child</td></tr><tr><td>Resource Home</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 - 9 of 9 items</span></div></div><script>
    jQuery(function(){jQuery("#gridDocumentType").kendoGrid({columns:[{title:"Name",field:"Name",encoded:true,editor:null}],pageable:{},sortable:true,filterable:true,editable:{confirmation:"Are you sure you want to delete this item?",mode:"popup",template:"\u003cdiv class=\"editor-label\"\u003e\u003clabel for=\"ID\"\u003eID\u003c/label\u003e\u003c/div\u003e\u003cdiv class=\"editor-field\"\u003e\u003cinput class=\"text-box\u0026\\#32;single-line\" data-val=\"true\" data-val-number=\"The\u0026\\#32;field\u0026\\#32;ID\u0026\\#32;must\u0026\\#32;be\u0026\\#32;a\u0026\\#32;number.\" data-val-required=\"The\u0026\\#32;ID\u0026\\#32;field\u0026\\#32;is\u0026\\#32;required.\" id=\"ID\" name=\"ID\" type=\"number\" value=\"0\" /\u003e \u003cspan class=\"field-validation-valid\" data-valmsg-for=\"ID\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv class=\"editor-label\"\u003e\u003clabel for=\"DispositionRuleID\"\u003eDispositionRuleID\u003c/label\u003e\u003c/div\u003e\u003cdiv class=\"editor-field\"\u003e\u003cinput class=\"text-box\u0026\\#32;single-line\" data-val=\"true\" data-val-number=\"The\u0026\\#32;field\u0026\\#32;DispositionRuleID\u0026\\#32;must\u0026\\#32;be\u0026\\#32;a\u0026\\#32;number.\" data-val-required=\"The\u0026\\#32;DispositionRuleID\u0026\\#32;field\u0026\\#32;is\u0026\\#32;required.\" id=\"DispositionRuleID\" name=\"DispositionRuleID\" type=\"number\" value=\"0\" /\u003e \u003cspan class=\"field-validation-valid\" data-valmsg-for=\"DispositionRuleID\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv class=\"editor-label\"\u003e\u003clabel for=\"Name\"\u003eName\u003c/label\u003e\u003c/div\u003e\u003cdiv class=\"editor-field\"\u003e\u003cinput class=\"text-box\u0026\\#32;single-line\" data-val=\"true\" data-val-required=\"The\u0026\\#32;Name\u0026\\#32;field\u0026\\#32;is\u0026\\#32;required.\" id=\"Name\" name=\"Name\" type=\"text\" value=\"\" /\u003e \u003cspan class=\"field-validation-valid\" data-valmsg-for=\"Name\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv class=\"editor-label\"\u003e\u003clabel for=\"rowguid\"\u003erowguid\u003c/label\u003e\u003c/div\u003e\u003cdiv class=\"editor-field\"\u003e\u003cinput class=\"text-box\u0026\\#32;single-line\" data-val=\"true\" data-val-required=\"The\u0026\\#32;rowguid\u0026\\#32;field\u0026\\#32;is\u0026\\#32;required.\" id=\"rowguid\" name=\"rowguid\" type=\"text\" value=\"00000000-0000-0000-0000-000000000000\" /\u003e \u003cspan class=\"field-validation-valid\" data-valmsg-for=\"rowguid\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv class=\"editor-label\"\u003e\u003clabel for=\"HasValue\"\u003eHasValue\u003c/label\u003e\u003c/div\u003e\u003cdiv class=\"editor-field\"\u003e\u003cinput class=\"check-box\" data-val=\"true\" data-val-required=\"The\u0026\\#32;HasValue\u0026\\#32;field\u0026\\#32;is\u0026\\#32;required.\" id=\"HasValue\" name=\"HasValue\" type=\"checkbox\" value=\"true\" /\u003e\u003cinput name=\"HasValue\" type=\"hidden\" value=\"false\" /\u003e \u003cspan class=\"field-validation-valid\" data-valmsg-for=\"HasValue\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e",window:{modal:true,draggable:true,resizable:false}},toolbar:{command:[{name:null,buttonType:"ImageAndText",text:"Add new item"}]},dataSource:{transport:{read:{url:"/DocumentType"},update:{url:"/DocumentType/Edit"},create:{url:"/DocumentType/Create"},destroy:{url:"/DocumentType/Delete"}},pageSize:10,page:1,total:9,serverPaging:true,serverSorting:true,serverFiltering:true,serverGrouping:true,serverAggregates:true,type:"aspnetmvc-ajax",filter:[],error:error,schema:{data:"Data",total:"Total",errors:"Errors",model:{id:"ID",fields:{ID:{type:"number"},DispositionRuleID:{type:"number"},Name:{type:"string"},rowguid:{type:"object"},HasValue:{editable:false,type:"boolean"}}}},data:{Data:[{"ID":1,"DispositionRuleID":7,"Name":"Adoption Assistance","rowguid":"19adf557-b31e-4c81-a9f2-abac883059f5","HasValue":true},{"ID":5,"DispositionRuleID":2,"Name":"CPS Child Fatality","rowguid":"6ca6be67-b96a-482a-864c-f0fa57eb364a","HasValue":true},{"ID":6,"DispositionRuleID":2,"Name":"CPS Non-Fatality","rowguid":"430c28aa-b05c-482f-8250-a83cca375504","HasValue":true},{"ID":3,"DispositionRuleID":2,"Name":"CSA Case Manager","rowguid":"d49942f9-9677-4e2c-8614-651e957f69d7","HasValue":true},{"ID":4,"DispositionRuleID":2,"Name":"CWBC","rowguid":"c265db91-2c10-415d-80ba-8f62eb24f9b1","HasValue":true},{"ID":9,"DispositionRuleID":2,"Name":"Education","rowguid":"1495df11-8192-4596-aa2d-93c0d76d03aa","HasValue":true},{"ID":8,"DispositionRuleID":2,"Name":"Family","rowguid":"3207a8ce-589d-44d9-993f-49f1c7f37770","HasValue":true},{"ID":2,"DispositionRuleID":2,"Name":"Home County Child","rowguid":"600987f3-56b9-4338-bf33-49b46c3e9990","HasValue":true},{"ID":7,"DispositionRuleID":2,"Name":"Resource Home","rowguid":"8a7a12f8-c84b-4096-bbce-4dd03499863c","HasValue":true}],Total:9}}});});
</script>

Razor Code
@model IEnumerable<WitWiyD.Models.DocumentType>
 
@{
    ViewBag.Title = "Index";
}
 
<h2>Index</h2>
 
<p>
    @Html.ActionLink("Create New", "Create")
</p>
 
@(Html.Kendo().Grid(Model)
    .Name("gridDocumentType")
    .ToolBar(toolbar => {
        toolbar.Create();   
    })
    .Columns(columns =>
    {
        columns.Bound(p => p.Name);
    })
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()   
    .DataSource(dataSource => dataSource
        .Ajax()
        .Model(model => model.Id(p => p.ID))
        .Events(events => events.Error("error"))
        .Read(read => read.Action("Index", "DocumentType"))
        .Create(create => create.Action("Create","DocumentType"))
        .Destroy(destroy => destroy.Action("Delete","DocumentType"))
        .Update(update => update.Action("Edit","DocumentType"))     
     )
)
 
@*<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.rowguid)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.HasValue)
        </th>
        <th></th>
    </tr>
 
@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.rowguid)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.HasValue)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
    </tr>
}
 
</table>*@
<script>
function error(e) {
    if (e.errors) {
        var message = "Errors:\n";
        $.each(e.errors, function (key, value) {
            if ('errors' in value) {
                $.each(value.errors, function() {
                    message += this + "\n";
                });
            }
        });
 
 
    alert(message);
}
 
 
}
</script>

Any ideas?
Paul
Top achievements
Rank 1
 answered on 08 Sep 2012
0 answers
404 views
When using editor templates by name like:

columns.Bound(x => x.Name).EditorTemplateName("String").Width(300);

Causes this to be rendered:

{"title":"Name","width":"300px","field":"Name","encoded":true,"editor":"%3cinput class=\"text-box single-line\" data-val=\"true\" data-val-required=\"Please provide a setting name.\" id=\"Name\" name=\"Name\" type=\"text\" value=\"\" /%3e%3cspan class=\"field-validation-valid\" data-valmsg-for=\"Name\" data-valmsg-replace=\"true\"%3e%3c/span%3e"}

Which then causes the grid, when inline editing to show the html encoded rather than endering the actual html it represents. I see an "encoded:true" but it doesn't seem to be treating the editor as encoded.

Thanks in advance.

EDIT: I blogged a workaround.

http://pknopf.com/blog/kendo-ui-editor-templates-for-asp-net 
Paul
Top achievements
Rank 1
 asked on 08 Sep 2012
1 answer
237 views
I am wondering if there is any sample code / API that can process the output after calling HtmlHelper.Partial(...).  In many cases, we use the same partial view to render the repeating items and also the template for when the user adds new items at the client.  The '#' character is the trouble.  In many cases a # character is used in an <a href='#'...  or else where which is not part of the template. Recently, I just used the following code to get around the href='#' issue,

var template = html.Partial(...);
string str = template.ToHtmlString();

str = str.Replace("href=\"#\"", "href=\"\\\\#\"");
str = str.Replace("href='#'", "href='\\\\#'");

return new MvcHtmlString(str);

it would be great if someone had a regex or a helper function that could escape all the non-template '#' characters.  I would really be unfortunate if I have to duplicate all my partial views just make them template safe.

Phil
Top achievements
Rank 1
 answered on 08 Sep 2012
5 answers
207 views
i am using kendo listview in which i am specifying url as below

$("#btnShowRestaurant").click(function () {
                alert('hiii');


                var dataSource = new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: "Restaurant.aspx/GetHotelData",
                            dataType: "jsonp"
                        }
                    },
                    pageSize: 12
                });

Is it they right way? because the webmethod in codebedhind is unreachable... any body having similar issue..any other option..

thanks in advance
             
             
Kushal
Top achievements
Rank 1
 answered on 08 Sep 2012
0 answers
106 views
I have four Kendo windows in my web page.
I am loading four windows during run time using JQuery.
Same time i need to indicate drag able area for the four windows.  
As per our requirement, the windows should drag limited area in web page and window docking system.
Please instruct me, there is any way to do this?

Prakash
Top achievements
Rank 1
 asked on 08 Sep 2012
3 answers
478 views

I'm having trouble binding data from a Web API Controller to a Grid. Unfortunately I haven't been able to find any examples of this.

Here's the API Controller:

public class FruitController : ApiController
{
    public class Fruit
    {
        public string Name { get; set; }
        public string Color { get; set; }
    }
 
    public IEnumerable<Fruit> GetFruits()
    {
        List<Fruit> list = new List<Fruit>();
 
        Fruit f = new Fruit();
        f.Name = "Apple";
        f.Color = "Red";
 
        list.Add(f);
 
        f = new Fruit();
        f.Name = "Kiwi";
        f.Color = "Green";
 
        list.Add(f);
 
        return list;
    }
}


And in my .cshtml file I have:

@model IEnumerable<FruitController.Fruit>
 
    @(Html.Kendo().Grid(Model)   
        .Name("Grid")
        .Columns(columns =>
        {
            columns.Bound(p => p.Name);
            columns.Bound(p => p.Color);
        })
        .Groupable()
        .Pageable()
        .Sortable()
        .Scrollable()
        .Filterable()
        .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("GetFruits", "api/Fruit").Type(HttpVerbs.Get)
 
            )
        )
    )



When I run this, I get a successful JSON response from the controller (seen via Chrome):

[{"Name":"Apple","Color":"Red"},{"Name":"Kiwi","Color":"Green"}]

But the grid has no data in it. Is there something obvious I am missing? I haven't been able to figure this out!

Thanks!

Tyler
Top achievements
Rank 1
 answered on 07 Sep 2012
1 answer
270 views
Dear Developers,

there is a bug in _validate method of the Editable widget. There is a line in the code (ln. 30578, kendo.web.js v2012.2.710) which tries to retrieve the input element:

input = $(':input[' + kendo.attr("bind") + '="' + (isBoolean ? 'checked:' : 'value:') + e.field + '"]', that.element);

If the field's name starts with 'first' or 'last' (e.g. first_name) the computed selector will be:

':input[data-bind="value:first_name"]'

In that case jQuery 1.8.0 can not find the element because the css parser throws an exception:

Uncaught Error: Syntax error, unrecognized expression: :input[data-bind="value

Obviously with jQuery 1.7.1 there is no exception.
This may be unconfortable in the future.
Alex Gyoshev
Telerik team
 answered on 07 Sep 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
Application
Map
Drag and Drop
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?