Telerik Forums
Kendo UI for jQuery Forum
2 answers
385 views

I am adding a click function to a column containing a button like so

            .Columns(columns =>
            {
                columns.Command(command =>
                {
                    command.Custom("customedit").Click("openScanLines").Text("").HtmlAttributes(new { title = "View Scan Details"});
                }).Width(75);
            })

We have an option to save the grid options to be loaded a later point.  So we use $("MyGrid").data("kendoGrid").getOptions() to get the options on the grid, Stringify it, and save it to a database  Then we pull that JSON string from the database and use $("MyGrid").data("kendoGrid").setOptions(options) to load them. The problem is the "Click" function is always missing from the $("MyGrid").data("kendoGrid").getOptions(), resulting in the Click function no longer working when the option are then set.  What's the deal?  How can I retain the click function for these columns?

  

Stefan
Telerik team
 answered on 10 Nov 2017
1 answer
166 views
I would like the ability to convert calculations to math symbols using mathJax and to do so I need to be able to put html inside a specific cell. Is there a way for me to change the innerhtml of a cell or a clean way of putting html inside of a cell?
Veselin Tsvetanov
Telerik team
 answered on 10 Nov 2017
4 answers
271 views

Hello.

 

we are testing the kendo ComboBox as part of our widget system , in order to integrate with angular we included kendo.directive modules.

the Original issue i wanted to solve was how to disable the angular binding on key press up and down .

Our directives are ES6 Classes and we using the kendo combo box directive , the problem here is its seems that the combo-box create another input element on the page and don't copy other attributes we added like angular ng-keydown , when  i used the post compile method to find the new kendo input element then adding the missing properties and then $recompile the input the browser was unresponsive.

 Using the kendo auto-complete directive was good because it's don't replace the original object.

 

 

   _getElementHtml() {
                var mapper = this.mapper;
                var item = mapper ? 'item' : 'item.key';
                var mdId = this.$attrs.mdId + (this.listIndex ? "-" + this.listIndex : "");
                var html = [];

                html.push("<div class='idi-combo-box'>");
                html.push("<span ng-show='$this.filterText'>{{$this.filterText}}</span>");
                var kendoType = this.isServerAutoComplete() ? 'auto-complete' : 'combo-box';

                html.push("<input kendo-" + kendoType + " k-on-open='onOpen(kendoEvent)'  k-options='comboConfig'  k-data-source='comboList'  k-on-select='onSelection(kendoEvent)' ");
                html.push(" type='text' ng-show='!$this.filterText' id='" + mdId + "'");
                html.push(" ng-model='kendoInput' ");
                html.push(" tooltip-placement='bottom' ");
                html.push(" tooltip='{{$this.tooltip}}' ");
                html.push(" ng-keydown='$this._onKeyDown($event)'");
                html.push(" ng-keypress='$this._onKeyPress($event,$this)'");
                html.push(" ui-mask='{{::$this.mask}}'");

                html.push((this.$attrs.readOnly ? 'readonly="readonly" ' : ''));

                html.push("/>");
                html.push("</div>");

                return html.join('');
            }

 

 

thanks in advance,

elad.

Alexander Popov
Telerik team
 answered on 10 Nov 2017
3 answers
486 views

I can not able to bind value in detailInit function in coloumn template: "<input ng-model='data.itemId' />", title: "item Id". data.itemId not working in children grid

 vm.gridOptions1 = {
            dataSource: {
                batch: true,
                data: [{
                    id: 1,
                    name: "Abra",
                    items: [{
                        itemId: 10,
                        sku: "ABC123"
                    }, {
                        itemId: 11,
                        sku: "DEF567"
                    }]
                }, {
                    id: 2,
                    name: "Kadabra",
                    items: [{
                        itemId: 20,
                        sku: "ABC678"
                    }, {
                        itemId: 21,
                        sku: "GHI567"
                    }]
                }]
            },
            detailInit: vm.detailInit,
            editable:true,                      
            navigatable:true,     
            columns: [{
                field: "id",
            }, {
                // field: "name",
                template: "<input type='text' ng-model='dataItem.name' />", title: "name"
            }, ]
        }

        function detailInit(e) {
            var dataTest = e.data.items;
            var grid = this;
            $("<div/>").appendTo(e.detailCell).kendoGrid({
                dataSource: dataTest,
                editable: true,
                columns: [{
                    // field: "itemId"
                     template: "<input ng-model='data.itemId' />", title: "item Id"
                }, {
                    field: "sku"
                      // template: "<input ng-model='dataItem.sku' />", title: "sku"
                } ],
                save: function() {
                    grid.one("dataBinding", function(e) {
                        e.preventDefault();
                    });
                }
            });
        }

 

Stefan
Telerik team
 answered on 10 Nov 2017
1 answer
2.8K+ views

I know this question has been asked many times but I was unable to find an answer, please help.
1. I need to update a value of the column "ProductName" that is not editable. I need to do it when I change (select) value in the dropdown Category

2. Keep the grid row in edit mode because I will change other fields in the row

3.  And then click Update button to update the grid row. Or cancel - to restore the original values in the row

 

Thank you!

 

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Kendo UI Snippet</title>

    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.3.1026/styles/kendo.common.min.css">
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.3.1026/styles/kendo.rtl.min.css">
    <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.2.607/styles/kendo.silver.min.css"/>
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.3.1026/styles/kendo.mobile.all.min.css">

    <script src="https://code.jquery.com/jquery-1.12.3.min.js"></script>
    <script src="https://kendo.cdn.telerik.com/2017.3.1026/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.3.1026/styles/kendo.default.min.css">
<script src="https://kendo.cdn.telerik.com/2017.3.1026/js/angular.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2017.3.1026/js/jszip.min.js"></script>
</head>
<body>
  
<script src="http://demos.telerik.com/kendo-ui/content/shared/js/products.js"></script>
<div id="example">
  <div id="grid"></div>
    <script>

        var dataSource = new kendo.data.DataSource({
            pageSize: 20,
            data: products,
            autoSync: false,
            schema: {
                model: {
                    id: "ProductID",
                    fields: {
                        ProductID: { editable: false, nullable: true },
                        ProductName: { validation: { required: true }, editable: false },
                        Category: { defaultValue: { CategoryID: 1, CategoryName: "Beverages"} },
                        UnitPrice: { type: "number", validation: { required: true, min: 1} }
                    }
                }
            }
        });

        $("#grid").kendoGrid({
            dataSource: dataSource,
            pageable: true,
            height: 430,
            toolbar: ["create"],
            columns: [
            { field:"ProductName",title:"Product Name" },
            { field: "Category", title: "Category", width: "160px", editor: categoryDropDownEditor, template: "#=Category.CategoryName#" },
            { field: "UnitPrice", title:"Unit Price", format: "{0:c}", width: "120px" },
            { command: ["edit", "destroy"], title: "&nbsp;", width: "250px" }],
            editable: "inline"
        });

        function categoryDropDownEditor(container, options) {
            $('<input required data-text-field="CategoryName" data-value-field="CategoryID" data-bind="value:' + options.field + '"/>')
            .appendTo(container)
            .kendoDropDownList({
                autoBind: false,
                dataSource: {
                    type: "odata",
                    transport: {
                        read: "http://demos.kendoui.com/service/Northwind.svc/Categories"
                    }
                },
                select: function() {
                    var grid = $("#grid").data("kendoGrid"),
                        model = grid.dataItem(this.element.closest("tr"));

                    model.ProductName = "changed";
                }
            });
        }
        </script>
</div>
</body>
</html>

Vadim
Top achievements
Rank 1
 answered on 09 Nov 2017
6 answers
818 views

How To Create Dynamic Menu using Kendo ui in MVC Razor Application..........
Nencho
Telerik team
 answered on 09 Nov 2017
1 answer
707 views
Hello,
 Is anyone know the way to change width of Kendo DropDownList dynamically by JavaScript (without use bootstrap.css)
Thanks.
Neli
Telerik team
 answered on 09 Nov 2017
7 answers
601 views

Hi,

 

I would like to validate the dropdown list dataSource in resouces:

resources: [{
  field: "ownerId",
  title: "Patient",
  validation: {
    required: true
  },
  dataSource: patientList
}]

But i didn't see it when create new event.  So, how can i validate it before create new event? and custom message validation error if it has?
P/s: I have tried to added the attribute required="required" to the select, it validate OK, but i can't save to create new event, even i have picked one from the list.
Lam
Top achievements
Rank 1
 answered on 09 Nov 2017
10 answers
541 views

Hello,

 

Is it possible to change the series background color when it is below some value for example 0.

I am trying to achieve something like the attached image.

Using Angular 4.

 

Thank you!

Georgi
Top achievements
Rank 1
 answered on 09 Nov 2017
1 answer
204 views

Hi,

I've been working with the async upload and have a requirement to get the chunk version working as per the example at http://demos.telerik.com/kendo-ui/upload/chunkupload

I've got this working as per the demo and uploading to a local file system and I can step through the code to see how this works. However the file storage is SQL Server Filestream (which I have working with the standard async version) and it needs to handle much larger files (2+ GB) so I need to chunk upload to prevent it timing out and to give the user an indication of progress.

So, based on the demo included above I need to implement the SQL calls to upload the chunks in the foreach loop in the ChunkSave method but I'm not sure how to acheive this taking into account I need to wrap the chunks in a transaction so that I know if it's succeeded or failed. In addition I need to save additional values against each file so I'm not sure how I would acheive this (have a check in the foreach loop to see if these values have already been set maybe?).

I've not been able to find any examples using the Kendo control so if anyone could offer some advice or point me to some examples that would be very much appreciated.

Thanks,

Mark

Veselin Tsvetanov
Telerik team
 answered on 09 Nov 2017
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?