Telerik Forums
Kendo UI for jQuery Forum
2 answers
623 views

I have a Kendo Editor defined as below:

      @(Html.Kendo().Editor()
      .Name("RestrictionsEditor")
      .Tag("div")
      .Tools(tools => tools
            .Clear()
            .Bold().Italic().Underline().Strikethrough()
            .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
            .CreateLink().Unlink()
            .InsertImage()
            .TableEditing()
            .FontColor().BackColor()
      )
      .Value(@<text><p>This is readonly editor initially and only gets in edit mode after button is clicked</p></text>))
        

Below is how I am making the Editor as readonly:

           <script type="text/javascript">
                $(function () {
                    var editor = $("#RestrictionsEditor").data("kendoEditor"),
                    editorBody = $(editor.body);

                    // make readonly
                    editorBody.removeAttr("contenteditable").find("a").on("click.readonly", false);
                })
                   
            </script>

 

I want to get editor in 'Edit' mode only when a button is clicked. Below is how I am defining my button:

                         <button class="btn-sm" id="edit">Edit</button>

 

I have defined my button just before initializing Kendo Editor.

 

And below is how I am trying to get the editor to edit mode:

         <script type="text/javascript">
                $("#edit .btn").click(function () {

                var editor = $("#RestrictionsEditor").data("kendoEditor"),
                editorBody = $(editor.body);
                
                editorBody.attr("contenteditable", true).find("a").off("click.readonly");
                })
            </script>

 

Now, when I run application my editor is in read only and when I click 'Edit' button, editor doesn't gets in edit mode and instead as soon as I click button, I m directed to the original page. Forgot to mention, my editor is inside a tab, which is inside of a modal.

 

Can you tell  me where I am doing wrong and how can I acheive th

 

Thanks!

RJ
Top achievements
Rank 1
 answered on 18 Apr 2016
1 answer
149 views

I've tested in Chrome (49.0.2623.112 m), Firefox (45.0.2), IE 11 (11.212.10586.0), and MS Edge (25.10586.0.0).

I'm having to programmatically resize some parent panes and a vertical splitter, it would be nice to bind that event and call my resize function there.

And while the contentLoad event doesn't appear to be working, the resize event does fire.

I'd also like to note that the kendoSplitter loads beautifully in IE 11.

 

Thanks!

Alex Gyoshev
Telerik team
 answered on 18 Apr 2016
1 answer
205 views

Is it possible to have jQuery run inside of an inline template?

Here's what I'm trying to accomplish.  I have an inline template that contains a form that the user fills out to submit back to my controller.  I have a set of radio buttons on the form.  If they click on the last radio button, I need my textarea to appear and be required for form submission.  

Here's my template:

<script type="text/x-kendo-template" id="rejectTemplate">
    <div id="reject-container">
        @using (Html.BeginForm("RejectConcern", "Filter", FormMethod.Post, new { @id = "rejectConcern", @style = "width:100%", @class = "k-content" }))
        {
            @Html.AntiForgeryToken()
            <input type="hidden" id="id" name="id" value="#= data.id #" />
            <table>
                <tr>
                    <td valign="top">
                        <label>Reason</label>
                    </td>
                    <td>
                        <label>
                            @Html.RadioButton("reasonForRejection", "NotQuestion", false, new { @id = "reasonForRejection" })Concern is not a question and will not be answered
                        </label>
                        <label>
                            @Html.RadioButton("reasonForRejection", "Inappropriate", false, new { @id = "reasonForRejection" })Concern contains inappropriate language and will not be answered
                        </label>
                        <label>
                            @Html.RadioButton("reasonForRejection", "Irrelevant", false, new { @id = "reasonForRejection" })Concern is not relevant to our business/operation and will not be answered
                        </label>
                        <label>
                            @Html.RadioButton("reasonForRejection", "Personal", false, new { @id = "reasonForRejection" })Concern is about an individual, a specific group, or area and will not be answered
                        </label>
                        <label>
                            @Html.RadioButton("reasonForRejection", "Other", false, new { @id = "reasonForRejection" })Other
                        </label>
                    </td>
                </tr>
                <tr>
                    <td> </td>
                    <td>
                    @Html.TextArea("answer",
                        new
                        {
                            @id = "answer",
                            @name = "answer",
                            @class = "k-textbox",
                            @placeholder = "Enter the reason for rejection here.",
                            @validationmessage = "The reason for rejection is required.",
                            @style = "width: 600px; min-width:600px; max-width:69%; height:200px",
                            @maxlength = "1000"
                        }
                    )
                     </td>
                </tr>
                <tr>
                    <td> </td>
                    <td>
                        <div class="actions">
                            <button type="submit" id="rejectConcernButton" class="k-button">Submit</button>
                        </div>
                    </td>
                </tr>
            </table>
        }
    </div>
</script>

How can I use jQuery to show/hide the answer textarea field depending on if the last radio button is checked or not?  If jQuery isn't possible, can it be done via regular JavaScript?

Dimiter Topalov
Telerik team
 answered on 18 Apr 2016
12 answers
1.6K+ views
I have a large grid that is in batch edit mode with only one or possibly two editable columns.  It is very important that the user can use keyboard navigation to move through the editable columns without using their mouse. 
I have a grid with navigatable turned on, but my problem is that it moves through all of the columns, not just the editable columns.  Is there a way to skip the columns that are not editable?

I am using MVC, but I have put together a quick sample on jsFiddle here: http://jsfiddle.net/jSeMZ/1/

Thanks!
~Logan
kishore
Top achievements
Rank 2
 answered on 18 Apr 2016
1 answer
449 views

I have a Gird which has a number of editable fields as well as some standardized auditing fields (LastUpdatedBy, LastUpdatedOn).

 

The later are intended to be read only.  So they are marked as Editable(false)

            model.Field(a => a.LastModifiedBy).Editable(false);
            model.Field(a => a.LastModifiedOn).Editable(false);

For the inline edit I am doing an Ajax call to controller action which processes the edit, updates the modified fields and passes the updated record back to the grid.  The grid displays the editable changes however I assume because they are non-editable the modified fields are not updated.  Doing a refresh of the page displays correct information but that is not desirable.

How can the behavior of Grid be override so that it will update the display of all model fields even the ones marked non-editable after an update?

 

 

Boyan Dimitrov
Telerik team
 answered on 18 Apr 2016
6 answers
417 views

Please read from here: http://stackoverflow.com/questions/36495655/get-column-name-from-container-or-create-generic-function-for-any-column

(There is also a support ticket open, so no admin has to sweat over here if they don't want to).

 

Because I'm using a lot of kendo grids spread in the whole web app, I start to introduce some redundant code that causes me a lot of troubles. Imagine to have something like:
//MVC:...

columns.Bound(c => c.Column1).Filterable(f => f.Extra(false).Operators(o => o.ForString(str => str.Clear().Contains("Contains"))).Cell(c => .ShowOperators(false).Template("column1Filter"))).Title("Column One");

...

//JS:

function column1Filter(container) {

container.element.kendoAutoComplete({

filter: "contains",

dataTextField: "Column1",

dataValueField: "Column1",

valuePrimitive: true,

dataSource: container.dataSource

});

}

Then, having this method reproduced for each single columns in each single grids. Is there any way where I can I have only one method that creates the kendo autocomplete?

E.G:

function genericAutocompleteFilter(container) {

var columnsName = //...Meh!

container.element.kendoAutoComplete({ filter: "contains", dataTextField: columnsName, dataValueField: columnsName, valuePrimitive: true, dataSource: container.dataSource });

}

Boyan Dimitrov
Telerik team
 answered on 18 Apr 2016
1 answer
493 views

Hello,

i have a tabstrip with 5 tabs all with LoadContentFrom

How can i check if a tab is loaded or not with jquery?

My problem is, that i have a dropdownlist outside the tabstrip and if i change the entry of the list i want to reload only the tabstrips with content inside.

Thanks!

Kiril Nikolov
Telerik team
 answered on 18 Apr 2016
1 answer
316 views

Hi,

I'm working with Angular and Kendo UI. I want to update an extising grid through an ajax call. I had to iterate over all items in datasource and compare them with the result of ajax call. If i got the item from the response, i had to update, if not i had to delete the item from the grid. Update works fine, if I doesnt use the getter and setter from the model. Now i only got problems with removing the items.

At first I changed the change event for the grid like preventDefaults, if im updating. Now my execution time was shrinking from ~100s to 13s. I tried the same for the datasource but it doesnt work.

Over all I got ~ 1200 items in my grid. I had to delete ~ 600. The average time per removing is 20ms, so the whole update takes 13sec and the most impact is located at the remove.

Is there any way to speed up the remove without recreate the datasource. If I recreate the datasource, i loose the focus and cant easyily reselect the items.

Thanks for your help.

 

Kiril Nikolov
Telerik team
 answered on 18 Apr 2016
1 answer
85 views

refer URL mentioned below

http://dojo.telerik.com/AMemE

 

I have added a focusout event for the textbox in which i disable the cap color drop down.

When we focusout from texttbox by clicking on Cap color drop down list, the list is shown in IE11 (not in chrome).

 

Please suggest a way to avoid this problem.

Konstantin Dikov
Telerik team
 answered on 18 Apr 2016
3 answers
591 views
Code to reproduce below and attached.

Screen shots attached.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="//getbootstrap.com/favicon.ico">
 
    <title>Sticky Footer Navbar Template for Bootstrap</title>
 
    <!-- Bootstrap core CSS -->
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
 
    <!-- Custom styles for this template -->
    <link href="//getbootstrap.com/examples/sticky-footer-navbar/sticky-footer-navbar.css" rel="stylesheet">
 
    <!-- Kendo UI styles -->
    <link rel="stylesheet" href="//cdn.kendostatic.com/2014.2.716/styles/kendo.common.min.css">
    <link rel="stylesheet" href="//cdn.kendostatic.com/2014.2.716/styles/kendo.rtl.min.css">
    <link rel="stylesheet" href="//cdn.kendostatic.com/2014.2.716/styles/kendo.default.min.css">
    <link rel="stylesheet" href="//cdn.kendostatic.com/2014.2.716/styles/kendo.dataviz.min.css">
    <link rel="stylesheet" href="//cdn.kendostatic.com/2014.2.716/styles/kendo.dataviz.default.min.css">
    <link rel="stylesheet" href="//cdn.kendostatic.com/2014.2.716/styles/kendo.mobile.all.min.css">
 
    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="http://getbootstrap.com/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="//getbootstrap.com/assets/js/ie-emulation-modes-warning.js"></script>
 
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="//getbootstrap.com/assets/js/ie10-viewport-bug-workaround.js"></script>
 
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <![endif]-->
 
    <style>
        body {
            overflow-x:hidden;
        }
        #toolbar {
            position: absolute;
            top: 50px;
            width: 100%;
        }
        #wrapper {
            position: absolute;
            top: 100px;
            position: absolute;
            left: 0;
            right: 0;
            bottom: 60px;
            overflow-y: scroll;
        }
        .area {
            min-height: 400px;
        }
        .placeholder {
            opacity: 0.4;
            border-style: dashed;
        }
        .hint {
            border-color: #333;
        }
    </style>
</head>
 
<body>
 
<!-- Fixed navbar -->
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Project name</a>
        </div>
        <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li class="active"><a href="#">Home</a></li>
                <li><a href="#about">About</a></li>
                <li><a href="#contact">Contact</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li class="divider"></li>
                        <li class="dropdown-header">Nav header</li>
                        <li><a href="#">Separated link</a></li>
                        <li><a href="#">One more separated link</a></li>
                    </ul>
                </li>
            </ul>
        </div><!--/.nav-collapse -->
    </div>
</div>
 
<!-- Toolbar -->
<div id="toolbar"></div>
 
<!-- Begin page content -->
<div id="wrapper">
    <div class="container">
        <div class="page-header">
            <h1>Numeric Textbox</h1>
        </div>
        <form role="form">
            <div class="row">
                <div class="col-sm-4">
                    <div class="form-group">
                        <label for="first-name" class="control-label">First Name</label>
                        <input id="first-name" type="text" class="form-control">
                    </div>
                    <div class="form-group">
                        <label for="last-name" class="control-label">Last Name</label>
                        <input id="last-name" type="text" class="form-control">
                    </div>
                </div>
                <div class="col-sm-3 col-sm-offset-1">
                    <div class="form-group">
                        <label for="occupation" class="control-label">Occupation</label>
                        <input id="occupation" type="text" class="form-control">
                    </div>
                    <div class="form-group">
                        <label for="age" class="control-label">Age</label>
                        <input id="age" type="number" class="form-control" data-role="numerictextbox">
                    </div>
                </div>
                <div class="col-sm-1 col-sm-offset-1">
                    <div class="form-group">
                        <label class="control-label">Gender</label>
                        <div class="radio">
                            <label>
                                <input type="radio" name="gender" id="male" value="1" checked>
                                Male
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" name="gender" id="female" value="2">
                                Female
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" name="gender" id="other" value="3">
                                Other
                            </label>
                        </div>
                    </div>
                </div>
                <div class="col-sm-1 col-sm-offset-1">
                    <div class="form-group">
                        <button type="button" class="btn btn-default">Go!</button>
                    </div>
                </div>
            </div>
            <div class="row"></div>
        </form>
    </div>
</div>
 
<div class="footer">
    <div class="container">
        <p class="text-muted">Place sticky footer content here.</p>
    </div>
</div>
 
 
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//cdn.kendostatic.com/2014.2.716/js/kendo.all.min.js"></script>
<script>
    $(document).ready(function() {
 
       kendo.init('body');
 
    });
</script>
</body>
</html>
Augusto
Top achievements
Rank 2
 answered on 15 Apr 2016
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?