Telerik Forums
Kendo UI for jQuery Forum
1 answer
40 views
An example line from my code:

$("#action-results-grid").data("kendoGrid").setDataSource(myDataSource);

How can I find a reference for the '.data("widget")' function, I have searched everywhere.

The examples clearly display how this function is used, but not once was it introduced in the tutorial documentation with a summary of it's functionality and why it is used.

My naive guess is that it returns an object wrapping the HTML element to provide methods associated with the widget, but still I would love to see a reference for this function to better understand how/when to use it and precisely what it does.

I can not find a reference to it in the API documentation.

Cheers,
Ross

Atanas Korchev
Telerik team
 answered on 18 Jun 2013
1 answer
94 views
Hi - the Kendo UI library does not work at all with Windows 8.  When attempting to add support to the project I get this javascript error:

Unhandled exception at line 3, column 12463 in ms-appx://2a623c8f-d20a-4b04-af23-abe9529a9b8d/js/jquery.min.js0x800c001c - JavaScript runtime error: Unable to add dynamic content. A script attempted to inject dynamic content, or elements previously modified dynamically, that might be unsafe. For example, using the innerHTML property to add script or malformed HTML will generate this exception. Use the toStaticHTML method to filter dynamic content, or explicitly create elements and attributes with a method such as createElement.  For more information, see http://go.microsoft.com/fwlink/?LinkID=247104.

This seems to be an issue with the jquery library being used, but Kendo UI requires version 1.9.1 so I cannot upgrade the jquery library.  Any fixes that will allow Kendo UI to be used within a Windows 8 app?

Thanks!
Atanas Korchev
Telerik team
 answered on 18 Jun 2013
3 answers
196 views
In this example: http://demos.kendoui.com/web/grid/detailtemplate.html how would you add a slide down animation to the detail row template so it isn't just BANG there?
Kate | D-Flo
Top achievements
Rank 1
 answered on 17 Jun 2013
3 answers
97 views
I am implementing a TreeView within a modal window.  The window works fine the first time it is initialized within its containing razor view.  But whenever the containing razor view is reloaded due to user navigation, I get the attached JavaScript exception within the _attachUids function shown below when the TreeView attempts its ajax call (LoadContentFrom) to my partial view.  Any insight is appreciated as I am still fairly new to the TreeView.

_attachUids:function(t,n){var i,r=this,o=u.attr("uid");t=t||r.root,n=n||r.dataSource,i=n.view(),t.children("li").each(function(t,n){n=e(n).attr(o,i[t].uid),n.attr("role","treeitem"),r._attachUids(n.children("ul"),i[t].children)})}
n=e(n).attr(o,i[t].uid) is the statement that faults with:

t = 0
i[t] = undefined
o = "data-uid"

My Partial View Is:

<script type="text/javascript">
    function onWSBrowseOK() {
        $("#WSBrowseWindow").data("kendoWindow").close();
    }
 
    function onWSBrowseCancel() {
        $("#WSBrowseWindow").data("kendoWindow").close();
    }
 
    function getParentWorkspace() {
        var parentId = 0;
        var treeView = $("#WSBrowseTreeView").data("kendoTreeView");
        if (treeView != null) {
            var selNode = treeView.select();
            if (selNode != null) {
                var dataItem = treeView.dataItem(selNode);
                if (dataItem != null) {
                    parentId = dataItem.id;
                }
            }
        }
        return { workspace_id: parentId };
    }
 
    function onWSBrowseChange(e) {
        var treeView = $("#WSBrowseTreeView").data("kendoTreeView");
        var selNode = treeView.select();
        var fileView = $("#WSBrowseFileTreeView").data("kendoTreeView");
        fileView.dataSource.read();
        e.preventDefault();
    }
</script>
 
<style>
    #WSBrowseButtons {
        text-align: center;
    }
 
        #WSBrowseButtons button {
            margin-top: 10px;
            margin-bottom: 10px;
            margin-right: 20px;
        }
</style>
 
@(Html.Kendo().Splitter()
    .Name("WorkspaceBrowser")
    .Orientation(SplitterOrientation.Horizontal)
    .Panes(vPanes =>
        {
            vPanes.Add()
                .HtmlAttributes(new { id = "WSBrowsePane" })
                .Scrollable(false)
                .Collapsible(false)
                .Resizable(true)
                .Size("50%")
                .Content(
                    Html.Kendo().TreeView()
                        .Name("WSBrowseTreeView")
                        .HtmlAttributes(new { style = "height: 100%; width: 100%;" })
                        .Events(events => events
                            .Change("onWSBrowseChange")
                            )
                        .DataSource(ds => ds
                            .Read(read => read.Action("GetWorkspaces", "Workspace"))
                            )
                        .ToHtmlString()
                );
 
            vPanes.Add()
                .HtmlAttributes(new { id = "WSFilePane" })
                .Scrollable(false)
                .Collapsible(false)
                .Content(
                    Html.Kendo().TreeView()
                        .Name("WSBrowseFileTreeView")
                        .HtmlAttributes(new { style = "height: 100%; width: 100%;" })
                        .DataSource(ds => ds
                            .Read(read => read.Action("WorkspaceFiles", "Workspace").Data("getParentWorkspace"))
                            )
                        .ToHtmlString()
                );
                 
        })
)
<div id="WSBrowseButtons">
    <button id="WSBrowseOK" onclick="onWSBrowseOK();">OK</button>
    <button id="WSBrowseCancel" onclick="onWSBrowseCancel();">Cancel</button>
</div>
The modal window container is defined as follows:

@(Html.Kendo().Window()
    .Name("WSBrowseWindow")
    .Title("Browse Workspaces")
    .LoadContentFrom("BrowseWorkspaces", "Workspace")
    .Width(600)
    .Resizable()
    .Draggable()
    .Modal(true)
    .Visible(false))
Controller Action Is As Follows.  The query could return zero rows, so I add at least one element to the result.

public JsonResult WorkspaceFiles(string id, string workspace_id)
{
    if (id == null)
        id = workspace_id;
 
    ISession session = NHibernateHelper.GetCurrentSession();
    List<WorkspaceModels.WorkspaceFilesModel> files = (List<WorkspaceModels.WorkspaceFilesModel>)session.GetNamedQuery("Workspace_GetFiles")
        .SetParameter("pPARENT_ID", id)
        .SetResultTransformer(Transformers.AliasToBean(typeof(WorkspaceModels.WorkspaceFilesModel)))
        .List<WorkspaceModels.WorkspaceFilesModel>();
    NHibernateHelper.CloseSession();
 
    if (files.Count() == 0)
    {
        WorkspaceModels.WorkspaceFilesModel defaultNode = new WorkspaceModels.WorkspaceFilesModel();
        defaultNode.DOCXID = AppConstants.NULL_GUID;
        defaultNode.DOCXNAME = "No Data";
        defaultNode.HASCHILDREN = 0;
        defaultNode.DOCXPARENTID = null;
 
        files.Add(defaultNode);
    }
 
    var fileItems = from e in files
                    where (string.IsNullOrEmpty(id) == false ? e.DOCXPARENTID == id : e.DOCXPARENTID == null)
                    select new
                    {
                        id = e.DOCXID,
                        text = e.DOCXNAME,
                        hasChildren = Convert.ToBoolean(e.HASCHILDREN)
                    };
 
    return Json(fileItems, JsonRequestBehavior.AllowGet);
}
Fred
Top achievements
Rank 1
 answered on 17 Jun 2013
2 answers
660 views
If I create a read only input field that uses a KendoUI date picker element, It still appears to be possible to change the date...

for example
<input id="startDate" type="date" name="startDate" value="1 Sep 2011" readonly="readonly" data-role="datepicker" data-format="d MMM yyyy"  />

In Chrone, the field appears to be read only, and you can't click in the field and manually edit it with the keyboard.
However, you can click on the Kendo UI Calendar icon, which pops up a calendar. Using the calendar, you can choose a new date like normal, which updates the text in the field.

Is there something I should be doing to prevent this? Is it a bug?
Jan Houwen
Top achievements
Rank 1
 answered on 17 Jun 2013
1 answer
110 views
Navigating to Views with params not working in icenium

for eg I am passing value like the following in item click 
onclick="itemclick(#=data.ID#,'#=data.Name#')"
app.navigate("nextpage.html");

In nextpage.html i am accessing the value by window.ID and and all these things work only if I comment out the line 
var app = new kendo.mobile.Application($(document).body,{ platform:'ios'});
and if i comment out the line my jquery events doesnt work..


any solutions..??
Steve
Telerik team
 answered on 17 Jun 2013
1 answer
151 views
I am building OData service and its response format is new OData v4.0 format.
http://docs.oasis-open.org/odata/odata-json-format/v4.0/csprd01/odata-json-format-v4.0-csprd01.html

However, Kendo's data source seems only support previous OData version.

For example, take a look at these two formats:
{
    "d" : {
        "results": [
        {
            "__metadata": {
                "uri": "http://demos/Orders(10248)",
                "type": "SampleModel.Order"
            },
            "ProductId": 10248,
            "Name": "Vgnon"
        }
        ],
        "__count": "1"
    }
}

------------------------------------------------------
OData v4.0
{

    "odata.metadata":"http://localhost:43111/api/$metadata#Products",
    "odata.count":"1",
    "value":
    [
        {
            "ProductId":2,
            "CreatedDate":"2013-06-10T23:53:26",
            "CreatedBy":0,"Name":"Camera"
        }
    ]
}

Can I tell the data source to expect new response format?
Petur Subev
Telerik team
 answered on 17 Jun 2013
1 answer
75 views
I dont see addition information about the touchScroller method. How does it work ? Any examples ?

Hector
Petyo
Telerik team
 answered on 17 Jun 2013
1 answer
162 views
I am using json for comment on post where i use kendo ui editor for summary. on success json i am trying to clear editor value by jquery like $('#editor').val(' ');
its not working.If i remove kendo editor its working fine. please help. 
Kris Nobels
Top achievements
Rank 2
 answered on 17 Jun 2013
7 answers
252 views
Hi I am trying to add a kendo dropdown list to a grid cell, but I am not sure how can I display the text in different color formats. So for instance we need to show values likes in a dropdownlist with the kendo cell grid.

Red X
Black X
Red numbers
Black Numbers

I have stored these values in a separate table and am linking them in the grid via Foreign Key Template. But I am not sure how can these values be html formatted.

One other approach was to link to editor to the cell but unfortunately going this route does not allow batch editing/saving. In this case I was not using a dropdownlist rather an editor and kept the cell free form.

Please suggest.
Dimiter Madjarov
Telerik team
 answered on 17 Jun 2013
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)
SPA
Filter
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
OrgChart
TextBox
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
Popover
DockManager
FloatingActionButton
TaskBoard
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
TimePicker
DateTimePicker
RadialGauge
ArcGauge
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?