Telerik Forums
Kendo UI for jQuery Forum
1 answer
116 views
I want to modify the edit window of the schedule application as I want to customize the fields for entering data. I want to add some rows and content specific to my application. 

How can I modify the edit window or provide my own window content? 

Paul
Alexander Popov
Telerik team
 answered on 28 Aug 2013
3 answers
237 views
Hello,

I tried to integrate the inline editor with headlines. Specifically I want the user being able to change the content between <h1></h1> tags.

1.) I added contentEditable directly to the H1 and H2 tags but it didn't work.
2.) I added contentEditable to a Div Wrapper around the H1 or H2 tag. I allow the user only to change bold/italic/underline style. When the user selects everything and deletes, also the H1 tag within the div wrapper is deleted. So the question is how I need to integrate the inline editor to allow the user to edit the content within the H1 tag without deleting it?

Thanks,

Philip
Alex Gyoshev
Telerik team
 answered on 28 Aug 2013
1 answer
58 views
Hi

I have been testing using Kendo Editor using version v2013.1.514 and it has been working with no problems. 

I received an extension to my testing account a number of days and tried to upgrade to the latest version using the instruction here , but when I do this the text box loses editor features and returns to a normal text box.

My original references are:

 <link rel="stylesheet" type="text/css" href="Content/kendo.common.min.css"/>
    <link rel="stylesheet" type="text/css" href="Content/kendo.default.min.css"/>

 <script type="text/javascript" src="Scripts/kendo.all.min.js"></script>

Jquery is already loaded on the page ahead of the Kendo js file.

The code I use to attach the editor is as follows:

  var editor = $('<div id="editor"/>');
    editor.appendTo($(element));
    editor.kendoEditor({
        change: onChange,
        tools: [
                 "bold",
                 "italic",
                 "underline",
                 "strikethrough",
                 "justifyLeft",
                 "justifyCenter",
                 "justifyRight",
                 "justifyFull",
                 "insertUnorderedList",
                 "insertOrderedList",
                 "indent",
                 "outdent",
                 "createLink",
                 "unlink",
                 "insertImage",
                 "subscript",
                 "superscript",
                 "createTable",
                 "addRowAbove",
                 "addRowBelow",
                 "addColumnLeft",
                 "addColumnRight",
                 "deleteRow",
                 "deleteColumn",
                 "viewHtml",
                {
                    name: "formatBlock", items: [
            // changes wrapping block to paragraph
            { text: "paragraph", value: "p" }
                    , { text: "H1", value: "h1" }
                     , { text: "H2", value: "h2" }
                     , { text: "H3", value: "h3" }
                    ]
                }

        ]
    });


Can you advise how I can update to the latest version?

Thanks 

Mark 

Iliana Dyankova
Telerik team
 answered on 28 Aug 2013
8 answers
1.3K+ views
I'm using a Kendo window to create a modal form launched
from a dropdown menu. The window launches fine and submits the form, which is a
CSHTML partial view. The problem is if I close the form using the form close
icon (X) I can no longer refresh or reload the form, also my cancel button is
round tripping to the server and loading the parent form in order to close out
the model window (this is a bad work around). Can you point me to the documentation
 on the kendo window close event which would allow me to refresh the modal window
 after it has been closed by the (X) icon and how I would implement a close button on a partial form loaded
from a controller into a kendo window. That’s 2 questions. Here is the code:

@* This is the widget configure window *@

<div id="WidgetWindow">

    @(Html.Kendo().Window()
    .Name("WidgetConfigWindow")
    .Title("Configure Widget")
   .Animation(false)  
   .Draggable()
    .Resizable()
    .Width(736)
    .Visible(false)
     .Modal(true)
 )
</div> 

  //invoke kendo window with partial window form
    //to add a widget to an area

    function NewWidgetWindow(areaname, widgettype) {
        var windowWidget = $("#WidgetConfigWindow").data("kendoWindow");
        var dropdownlist = $("#dashboards").data("kendoDropDownList");
        var dataItem = dropdownlist.dataItem();
        var parms = { "DashboardID": dataItem.DashboardID, "AreaName": areaname,         "WidgetType":
widgettype };
        windowWidget.refresh({
            data: parms,
            url: "@Url.Action("GetWidgetWindow", "Dashboard")"
            });
            windowWidget.center();
            windowWidget.open();
    }

public ActionResult GetWidgetWindow(string DashboardID, string AreaName, string WidgetType)   
        {
            //Pass apartial view to a kendo window
            //which onfigures the widget for the appropriate area
            ViewBag.DashboardID = DashboardID;
            ViewBag.AreaName = AreaName;
            if (AreaName == "Marquee")
            {
                if (WidgetType == "Q")
                {
                    return PartialView("QWidget");
                }
                else if (WidgetType == "A")
                {
                    return PartialView("QWidget");
                }
            } else if (AreaName == "AOne")
                {
                if (WidgetType == "Q")
                {
                    return PartialView("QWidget");
                }
                else if (WidgetType == "A")
                {
                    return PartialView("AWidget");
                }
            }
            return PartialView("QWidget");
        }

//**************AWidget.CSHTML**********************
<script src="~/Scripts/kendo/2013.1.514/jquery.min.js"></script>
<script src="~/Scripts/kendo/2013.1.514/kendo.all.min.js"></script>
<script src="~/Scripts/kendo/2013.1.514/kendo.web.min.js"></script>
<script src="~/Scripts/kendo/2013.1.514/kendo.aspnetmvc.min.js"></script>

 

@using (Html.BeginForm("AWidget", "Dashboard", FormMethod.Post))
{
    //hide dashboard ID which gets passed in veiwbag
   <input id='DashboardID' name='DashboardID' value='@ViewBag.DashboardID' hidden="hidden"/>
   <input id='AreaName' name='AreaName' value='@ViewBag.AreaName' hidden="hidden"/>

   <table border="0">
      <tr style ="vertical-align:Top">
          <td style ="vertical-align:top">
           <h5>Select Agent: </h5>
             @(Html.Kendo().DropDownList()
                  .Name("AID")
                  .Value("Select a Queue...") // need to set this at runtime
                  .DataTextField("AName")
                  .DataValueField("AID")
                  .DataSource(source =>
                  {
                      source.Read(read =>
                      {
                          read.Action("GetA", "ASummary", new { area = "Reports" });
                      });
                  })
            )
            @*@Html.ValidationMessageFor(r=>r.AID)*@
        </td>
        <td style ="vertical-align:top">
        </td>
         <td style ="vertical-align:top">
        </td>
   </table>
    <div class="accordion" id="accordion2">
      <div class="accordion-group">
        <div class="accordion-heading">
          <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
            Include These Fields: &#8595;
          </a>
        </div>
        <div id="collapseOne" class="accordion-body collapse in">
          <div class="accordion-inner">
              <table border="0">
               <tr>
                <td style ="vertical-align:top">
                    <input type="checkbox" name="Include" value="LAST_UPDATE" checked />Last Updated<br />
                    <input type="checkbox" name="Include" value="STATUS" checked />Status<br />
                    <input type="checkbox" name="Include" value="REASON" checked />Reason<br />
                </td>
                <td>
                </td>
                <td style ="vertical-align:top">
                </td>
              </tr>
            </table>
          </div>
        </div>
      </div>
    </div>
    <p>
    <input type="submit" value="Cancel" name="AWidget" /> 
    <input type="submit" value="Create" name="AWidget" />
    </p>
}
Petur Subev
Telerik team
 answered on 28 Aug 2013
3 answers
361 views
Why does the k-invalid-msg span on a multiselect validator not line up like on any other control?

Testing.html
<!DOCTYPE html>
<html>
<head>
<title>Testing</title>
<link href="http://cdn.kendostatic.com/2013.2.716/styles/kendo.common.min.css" rel="stylesheet" />
<link href="http://cdn.kendostatic.com/2013.2.716/styles/kendo.default.min.css" rel="stylesheet" />
<script src="http://cdn.kendostatic.com/2013.2.716/js/jquery.min.js"></script>
<script src="http://cdn.kendostatic.com/2013.2.716/js/kendo.all.min.js"></script>
</head>
<body>
<div id="grid"></div>
<div id="editform"></div>
<script>
var editWindow;
$(document).ready(function () {
var crudServiceBaseUrl = "http://demos.kendoui.com/service",
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: crudServiceBaseUrl + "/Products",
dataType: "jsonp"
},
update: {
url: crudServiceBaseUrl + "/Products/Update",
dataType: "jsonp"
},
destroy: {
url: crudServiceBaseUrl + "/Products/Destroy",
dataType: "jsonp"
},
create: {
url: crudServiceBaseUrl + "/Products/Create",
dataType: "jsonp"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
},
batch: true,
pageSize: 20,
schema: {
model: {
id: "ProductID",
fields: {
ProductID: { editable: false, nullable: true },
ProductName: { validation: { required: true} },
UnitPrice: { type: "number", validation: { required: true, min: 1} },
Discontinued: { type: "boolean" },
UnitsInStock: { type: "number", validation: { min: 0, required: true} }
}
}
}
});

$("#grid").kendoGrid({
dataSource: dataSource,
pageable: true,
height: 430,
columns: [
{ field: "ProductName", title: "Product Name" },
{ field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "100px" },
{ field: "UnitsInStock", title: "Units In Stock", width: "100px" },
{ field: "Discontinued", width: "100px" },
{ command: [{ name: "edit", text: "", click: showEdit }, { name: "destroy"}], title: "&nbsp;", width: "160px"}]
});
});
function showEdit(e) {
e.preventDefault();
editWindow = $("#editform")
.kendoWindow({
title: "Edit Test",
modal: true,
visible: false,
resizable: false,
width: 960,
content: { url: "EditTemplate.htm" }
}).data("kendoWindow");
$("#editform").closest(".k-window").css({
top: 10,
left: 10
});
editWindow.open();
}
</script>
<style scoped>
body
{
font-family: 'Century Gothic';
font-size: 11px;
}
</style>
</body>
</html>


EditTemplate.html

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div>
<div id="addRule-div">
<div>
<label for="LoanProduct" class="control-label">Loan Products:</label>
<div>
<select style="width:450px;" id="LoanProduct" name="LoanProduct" multiple="multiple" data-placeholder=" " required validationMessage="Loan Product required.">
<option>Test</option>
<option>Testing</option>
</select>
<span class="k-invalid-msg" data-for="LoanProduct"></span>
</div>
</div>
<div>
<label for="Title" class="control-label">Title:</label>
<div>
<input style="width:450px;" id="Title" name="Title" class="k-textbox" required validationMessage="Title is required." />
<span class="k-invalid-msg" data-for="Title"></span>
</div>
</div>
<div>
<div>
<button id="addRule-Button" class="k-button" type="submit">Add Rule</button>&nbsp;
</div>
</div>
</div>
</div>
<script>
$(function () {
$("#LoanProduct").kendoMultiSelect().data("kendoMultiSelect");
var validator = $("#addRule-div").kendoValidator().data("kendoValidator");
$("#addRule-Button").click(function () {
if (validator.validate()) {
console.log("validate");
}
});
});
</script>
</body>
</html>
Dimo
Telerik team
 answered on 28 Aug 2013
2 answers
481 views
Hi All,

I am trying to save the image captured from the camera to the database, i am using Jquery Ajax call with JSONP,  when the image data is very large the request is not caught by the webservice on the server side . I have researched a lot on this changing the maximum request length and maxjsonlength values in the web config, but still i found no solution for this . Also i came across a post saying to send the data in packets but the implementation part was not mentioned in the post.   Please someone guide me on this as it is has taken a lot of time already.

Thanks

Gaja Naik
Gaja
Top achievements
Rank 1
 answered on 28 Aug 2013
28 answers
1.2K+ views
Hello,

I'm very interested in using Kendo UI for my upcoming project. However, i have two needs that need to be met. I would like to figure out how to integrate them into my test project. For my test project, I'm just altering the index.html in the examples/web/grid directory. Within this grid, I need to support:

  1. Double-Clicking on a row. When someone double-clicks on a row, I want to just show an an alert window that says "Hello", just to see it working.
  2. Context-Menu on a row. When someone right-clicks on a row, I need to show a popup menu. I know this won't work in touch-based environments. But we're building a desktop solution and context-menu is a requirement, not an option :(.
Is it possible to do these? If so, how do you do it on the example grid?

Thank you!
Stefan Timm
Top achievements
Rank 2
 answered on 28 Aug 2013
7 answers
369 views
I'm trying to incorporate a drop down list in a nested grid using the mvc3 wrappers, is this feasible if so does anyone have an example using the mvc wrappers?  I keep getting a js error saying User is undefined.

Here is what my grid looks like :

<div style="width: 95%; margin-left: auto; margin-right: auto;">
    @(Html.Kendo().Grid<ConfigProject>()
      .Name("projects-grid")
      .Columns(c =>
          {
              c.Bound(m => m.Name);
              c.Bound(m => m.Id);
              c.Bound(m => m.Description);
              c.Command(command =>{command.Edit(); command.Destroy(); }).Width(170);
          })
      .ToolBar(toolbar=>toolbar.Create())
      .Editable(editable=>editable.Mode(GridEditMode.PopUp))
      .Scrollable()
      .Pageable()
      .Sortable()
      .DataSource(datasource => datasource
        .Ajax()
        .Model(model => model.Id(p => p.Id))
        .Read(read => read.Action("ProjectsRead","ConfigEditor",new {Area="Config"}))
        .Create(create => create.Action("CreateProject", "ConfigEditor",new {Area="Config"}))
        .Update(update => update.Action("ProjectUpdate", "ConfigEditor",new {Area="Config"}))        
        .Destroy(destroy => destroy.Action("ProjectDestroy", "ConfigEditor",new {Area="Config"}))
      )
      .ClientDetailTemplateId("detail-template")
      .Resizable(resize => resize.Columns(true))
      .HtmlAttributes(new { style = "height:550px;" })
    )
</div>

<script id="detail-template" type="text/kendo-tmpl">
    @(Html.Kendo().TabStrip()
          .Name("tabStrip_#=Id#")
          .SelectedIndex(0)
          .Items(items =>
              {
                  items.Add().Text("Config Settings").Content(@<text>
                    @(Html.Kendo().Grid<ConfigSetting>()
                          .Name("projects-setttings_#=Id#")
                          .Columns(columns =>
                              {
                                  columns.Bound(o => o.Key);
                                  columns.Bound(o => o.Value);
                                  columns.Bound(o => o.Description);
                                  columns.Command(command => command.Destroy()).Width(110);
                              })
                          .ToolBar(toolbar => {
                                toolbar.Create();
                                toolbar.Save();      
                          })
                          .Editable(editable => editable.Mode(GridEditMode.InCell))
                          .DataSource(dataSource => dataSource
                                .Ajax()
                                .Batch(true)
                                .PageSize(8)
                                .Model(model => model.Id(cs => cs.Key))
                                .Read(read => read.Action("GetConfigsForProject", "ConfigEditor", new { Area="Config", projectID = "#=Id#" }))
                                .Create(create => create.Action("CreateSettings", "ConfigEditor", new { Area="Config", projectID="#=Id#"}))
                                .Update( update => update.Action("EditSettings", "ConfigEditor", new{Area="Config",projectID="#=Id#"}))
                                .Destroy(destroy => destroy.Action("DestroySettings", "ConfigEditor", new {Area ="Config",projectID="#=Id#"}))
                          )
                          .Events(e=>e.Edit("readonlyifyKey"))
                          .Resizable(resize => resize.Columns(true))
                          .Pageable()
                          .Sortable()
                          .ToClientTemplate())
                </text>                        
                      );
                  
                  items.Add().Text("Authorized Users").Content(@<text>
                    @(Html.Kendo().Grid<ConfigAdminUserModel>()
                          .Name("projects-AdminUsers_#=Id#")
                          .Columns(columns =>
                              {
                              columns.Bound(o => o.UserId).Visible(false);
                              columns.Bound(o => o.User).ClientTemplate("#=User.UserName#");
                              columns.Command(command => command.Destroy()).Width(110);
                          })
                          .ToolBar(toolbar =>
                          {
                              toolbar.Create();
                              toolbar.Save();
                          })
                          .Editable(editable => editable.Mode(GridEditMode.InCell))
                          .DataSource(dataSource => dataSource
                                .Ajax()
                                .Batch(true)
                                .ServerOperation(false)
                                .Model(model =>
                                    {
                                        model.Id(cs => cs.UserId);
                                        model.Field(cs => cs.UserId).Editable(false);
                                        model.Field(cs => cs.User).DefaultValue(
                                            ViewData["defaultUser"] as ConfigAdminUser);
                                    })
                                .Read(read => read.Action("AdminUserRead", "ConfigEditor", new { Area = "Config", projectID = "#=Id#" }))
                                .Create(create => create.Action("CreateSettings", "ConfigEditor", new { Area = "Config", projectID = "#=Id#" }))
                                .Update(update => update.Action("EditSettings", "ConfigEditor", new { Area = "Config", projectID = "#=Id#" }))
                                .Destroy(destroy => destroy.Action("DestroySettings", "ConfigEditor", new { Area = "Config", projectID = "#=Id#" }))
                          )
                          .Pageable()
                          .Sortable()
                          .ToClientTemplate())
                </text>                        
                      );
                      
                      
                  items.Add().Text("Team Contact Information").Content(
                    "<div class='team-contact-details'>" +
                    "<ul>" +
                    "<li><label>Name: </label>#= Team.Name #</li>" +
                    "<li><label>Description: </label>#= Team.Description #</li>" +
                    "<li><label>Email: </label>#= Team.Email #</li>" +
                    "<li><label>Pager: </label>#= Team.Pager #</li>" +
                    "</ul>" +
                    "</div>"
                    );           
              })
          .ToClientTemplate())
</script>
Vladimir Iliev
Telerik team
 answered on 28 Aug 2013
1 answer
52 views
Hi,

I found exception thrown if a DataViz widget is included in a validation div. The error thrown is:
Uncaught TypeError: Object #<SVGAnimatedString> has no method 'indexOf'
I tracked the source code: line 11448 in kendo.all.js:
if (element.className.indexOf(INVALIDMSG) > -1) {
For the SVG object representing chart, element.className does not have method of "indexOf".

I changed it to this to avoid the issue:
if (element.className.indexOf && element.className.indexOf(INVALIDMSG) > -1) {
Here is my test page (modified from online demo), also attached.
<!DOCTYPE html>
<html>
<head>
    <title>Kendo UI Chart with Input Validation Issue</title>
    <meta charset="UTF-8">
</head>
<body>
    <div id="example" class="k-content">
        <div class="chart-wrapper">
            <div id="chart"></div>
        </div>
        <label for="name">Name: </label>
        <input type="text" id="name" required />
        <span class="k-invalid-msg" data-for="name"></span>
        <button id="test">Test</button>
    </div>
 
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
 
    <script>
        (function($){
            function createChart() {
                $("#chart").kendoChart({
                    title: {
                        text: "Site Visitors Stats /thousands/"
                    },
                    legend: {
                        visible: false
                    },
                    seriesDefaults: {
                        type: "bar"
                    },
                    series: [{
                        name: "Total Visits",
                        data: [56000, 63000, 74000, 91000, 117000, 138000]
                    }, {
                        name: "Unique visitors",
                        data: [52000, 34000, 23000, 48000, 67000, 83000]
                    }],
                    valueAxis: {
                        max: 140000,
                        line: {
                            visible: false
                        },
                        minorGridLines: {
                            visible: true
                        }
                    },
                    categoryAxis: {
                        categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
                        majorGridLines: {
                            visible: false
                        }
                    },
                    tooltip: {
                        visible: true,
                        template: "#= series.name #: #= value #"
                    }
                });
            }
 
            $(document).ready(function(){
                var validator = $('#example').kendoValidator().data('kendoValidator');
                createChart();
 
                $(document).bind("kendo:skinChange", createChart);
                $('#test').on('click', function(e){
                    alert('validation: ' + validator.validate());
                });
            });
        })(jQuery);
    </script>
 
    <style scoped>
        .chart-wrapper, .chart-wrapper .k-chart {
            height: 350px;
        }
    </style>
 
</body>
</html>

Regards,

Gong
T. Tsonev
Telerik team
 answered on 28 Aug 2013
1 answer
250 views
How do I have my form input elements "kendo styled" without having to add then to a <ul><li> element and how do I have the label on top?

http://docs.kendoui.com/getting-started/mobile/forms says that most  form elements are supported and styled if added to a mobile view.
However, only if I add form input elements into a <ul><li> hierarchy are they styled automatically:

Styled:
<div data-role="view" data-layout="layout1" data-title="Sign in" id="signin-view">
  <ul data-role="listview" data-style="inset">
    <li>
      <label>Username<input id="txtUsername" type="text" data-bind="value: username" /></label>
    </li>

Not styled:
<div data-role="view" data-layout="layout1" data-title="Sign in" id="signin-view">
<input id="txtUsername" type="text" data-bind="value: username" />
Kiril Nikolov
Telerik team
 answered on 28 Aug 2013
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?