Telerik Forums
Kendo UI for jQuery Forum
3 answers
716 views

We need to run some user confirmations for certain changes that occur with our incell-edited table. Our standard confirmation dialog is an async dialog, not Window.confirm(), which seems to cause some problems.

If we were just using the synchronous confirm(), then we could easily preventDefault() upon rejection, but the async confirm comes too late for that.

Additionally, there are times that we want to modify the value that the user enters as part of the save() call, but I haven't figured out how to get that to work.

In this fiddle (http://jsfiddle.net/LMFinney/3qkpLjvt/2/), I've simulated the async confirm dialog by wrapping confirm() in a Promise.resolve(). And I've simulated changing the value of the user-entered data by doubling odd entries. In this case, preventDefault() doesn't work because it's too late, and setting the modified value actually clears the value instead.

Is there another approach for these two issues?

Lance
Top achievements
Rank 1
 answered on 24 May 2016
2 answers
152 views

I have a simple grid with filter (row mode), and it seems the grid fails to add new items when the filter is applied. Clicking the "Add new record" does nothing, not even triggering the grid `edit` event. 

 

I have found this question on StackOverflow: http://stackoverflow.com/questions/17840312/cant-add-new-object-to-kendoui-grid-if-filter-is-applied-to-any-column but this seems an overly-complicated solution to a simple problem.  Is there a more direct way of allowing the creation of new items while filter is on?  I don't mind if I'll have to clear all filter fields, as long as the user doesn't have to do so manually.  

Dimiter Madjarov
Telerik team
 answered on 24 May 2016
1 answer
714 views

I have a Kendo UI grid control that has three columns: Price Code, Description, and Quantity. The Price Code uses a DropDownList as a custom editor that changes the value of the Description field once selected. The problem that I'm having is that although the Description field changes when the DropDownList is changed, the Quantity field is reset to 0 when any of the fields in the row are changed. Here is my code:

<div id="workorderdetails" style="padding-top: 2em;">
    <div id="grid"></div>
 
    <script>
        $(document).ready(function () {
            $("#client").kendoAutoComplete({
                template: "<span class='client-id'>#= AccountNumber #</span> <span class='branch-id'>#= (Branch == null) ? ' ' : Branch #</span> <span class='department-id'>#= (Department == null) ? ' ' : Department #</span> #= Name #",
                dataTextField: "Name",
                height: 520,
                dataSource: {
                    type: "json",
                    transport: {
                        read: "http://localhost:53786/api/client"
                    },
                    schema: {
                        model: {
                            fields: {
                                AccountNumber: { type: "number" },
                                Branch: { type: "string" },
                                Department: { type: "string" },
                                Name: { type: "string" }
                            }
                        }
                    },
                    pageSize: 80,
                    serverPaging: true,
                    serverFiltering: false
                }
            });
 
            // create DatePicker from input HTML element
            $("#datepicker").kendoDatePicker({
                format: "dddd, MMMM d, yyyy"
            });
 
            $("#grid").kendoGrid({
                dataSource: {
                    transport: {
                        read: {
                            url: "http://localhost:53786/api/workorder/1/workorderdetails",
                            dataType: "json"
                        }
                    },
                    schema: {
                        model: {
                            fields: {
                                WorkOrderID: { type: "number" },
                                ShortCode: { defaultValue: { PriceCodeID: 1436, ShortCode: "REF3" } },
                                Description: { type: "string" },
                                Quantity: { type: "number" }
                            }
                        }
                    }
                },
                pageable: true,
                height: 550,
                toolbar: ["create"],
                columns: [
                    { field: "ShortCode", title: "Price Code", editor: shortcodeDropDownEditor, template: "#=ShortCode.ShortCode#" },
                    { field: "Description", title: "Description", editable: "false" },
                    { field: "Quantity", title: "Quantity" },
                    { command: ["edit", "destroy"], width: "150px" }],
                editable: true,
                save: function (e) {
                    if (e.values.ShortCode !== "") {
                        var test = e.model.set("Description", e.values.ShortCode.Description);
                    }                       
                }
            });
 
            $("#warehouse").kendoDropDownList({
                dataTextField: "Name",
                dataValueField: "WarehouseID",
                dataSource: {
                    valueTemplate: "#= Name#",
                    template: '#= Name# <h3>#= Address1#, #= City #, #= Province#, #= Country#</h3>',
                    transport: {
                        read: {
                            url: "http://localhost:53786/api/warehouse",
                            dataType: "json"
                        }
                    },
                    schema: {
                        model: {
                            fields: {
                                WarehouseID: { type: "number" },
                                Name: { type: "string" },
                                Address1: { type: "string" },
                                City: { type: "string" },
                                Province: { type: "string" },
                                Country: { type: "string" }
                            }
                        }
                    }
                }
            });
        });
 
        function shortcodeDropDownEditor(container, options) {
            $('<input required data-text-field="ShortCode" data-value-field="PriceCodeID" data-bind="value:' + options.field + '"/>')
                .appendTo(container)
                .kendoDropDownList({
                    valuePrimitive: false,
                    dataTextField: "ShortCode",
                    dataSource: {
                        transport: {
                            read: {
                                url: "http://localhost:53786/api/pricecodes/unique",
                                dataType: "json"
                            }
                        }
                    }
                });
        }
 
    </script>

In addition, I'd like to make it such that the user cannot edit the Description field manually; it can only be altered by changing the Price Code.

 

 

Dimiter Topalov
Telerik team
 answered on 24 May 2016
5 answers
385 views
Hello,

I have problem with grid aggregates.

When data changes, on Save event everything is fine – aggregates recalculated and label updated correctly. But when row is deleted, aggregates refresh only after event Remove. As result the label shows wrong, not updated number. Is any way to work it around?

http://jsfiddle.net/oucyngdf/

Thank you in advance.
Ruben
Top achievements
Rank 1
 answered on 24 May 2016
1 answer
414 views

Hi,

I have created a kendoWindow with this code

function CustomerPopupEditor() {
    $("#showCustomerEdit").append("<div id='window'></div>");
    var myWindow = $("#window").kendoWindow({
        width: "80%",
        height: "47%",
        title: "Customer",
        content: "/Customer/CustomerEditor",
        modal: true,
        actions: [
            "Close"
        ],
        close: function (e) {
            $("#window").empty();
        }
    }).data("kendoWindow");
    myWindow.center().open();
}

 

and I am closing the window using this code

function CloseTheWindow() {
    $("#window").data("kendoWindow").close();
}

this is called on a button click event, when I get this window open, it works fine, I click my Save button it closes it. However if I open it again and try to close it, the window won't close.

I am not sure if this is enough information or if I need to add more information.

 

Thanks

Dimiter Madjarov
Telerik team
 answered on 24 May 2016
2 answers
982 views

Hi Guys,

 

I'm trying to locate the unminified kendo culture JS files to modify for a custom culture in my application but for some reason i cant seem to locate them anymore in latest Kendo installation 2016.2.504 UI for ASP.NET MVC Q2 2016.

Can you point me out to a location where to find the culture file source?

 

Cheers!

 

 

IT
Top achievements
Rank 1
 answered on 24 May 2016
4 answers
929 views

Hello

Can we customize the measure based on some other column values? eg: If I have measures like below,

 measures: {
                            "ChainShare": { field: "ChainShare", aggregate: "sum" },
                            "DemandIndex":{field:"DemandIndex",aggregate: "sum"},
                            "GroupShare":{field:"GroupShare",aggregate: "sum"}
                        }

Then can we define DemanIndex field as ChainShare/GroupShare .

 

Thanks and Regards

Satabdi

Georgi Krustev
Telerik team
 answered on 24 May 2016
4 answers
269 views

I have an issue where the initial popup is opened above the drop down list and when you filter and the list becomes small enough it drops below the anchor. 

 Problem is when the drop down is on the bottom of a scrollable page the drop down is obscured and the user can't select the value because the drop down is off screen and when scrolling it closes automatically.

 

Is there anyway to make the position of the popup sticky? 

 

thanks

 

Justin.

Dimiter Topalov
Telerik team
 answered on 24 May 2016
1 answer
771 views

I'm trying to setup auto-completion on a single column in my grid. This is being implemented in a backbone+marionette app. I'm following this example for the implementation http://jsfiddle.net/OnaiBai/Naka3/18

The view is instantiated in my controller. Nothing happens when I enter text into the input box. Also there aren't any JS errors. 

I can include more of the code if necessary. Any ideas on how I can get the auto-completion to work.

Template App.Templates.Search.SearchBoxStuff : 

<label class="search-label" for="searchBox">Search Grid:</label>
<input type="search" id="searchBox" class="k-textbox text-input">

 

View:

App.SearchStuff.GridView = App.Common.Widgets.Grid.extend({
    /**
     * Constructor
     */
    constructor: function (options) {
        App.Common.Widgets.Grid.call(this,
            _.extend({
                toolbar: [
                    { template: App.Templates.Search.SearchBoxStuff }
                ],
                dataSource: {
                    type: 'odata',
                    pageSize: 100,
                    serverFiltering: true,
                    serverPaging: true,
                    serverSorting: true,
                    sort: {
                        field: 'name',
                        dir: 'asc'
                    },
                    schema: {
                        model: {
                            fields: {
                                id: {type: 'number'},
                                name: {type: 'string'}
                             
                    
 
                            }
                        }
                    },
                    transport: {
                        read: {
                            url: '/api/package/search/v1',
                            dataType: 'json',
                            type: 'POST',
                            contentType: 'application/json'
                        },
                        parameterMap: _.bind(this._parameterMap, this)
                    }
                },
                height: 700,
                scrollable: {
                    virtual: true
                },
                selectable: 'row',
                sortable: true,
                pageable: false,
                columns: [{
                    field: 'name',
                    title: 'Name'
                }
 
            }, options));
 
$('.text-input').kendoAutoComplete({
            dataTextField: 'name',
            dataVextField: 'name',
            dataSource: this.dataSource
        });
 
    },

Georgi Krustev
Telerik team
 answered on 23 May 2016
1 answer
133 views

I have currently added the following custom validation to my interest name, but interest name has to be unique, so when user add new and existing interest name is already there, it will throw error. However, when user try to edit the record, it should be able to detect whether current interest name is changed, if it is a new interset name then only check only uniqueness validation, otherwise, it should allow the update to go through successfully.

With the following validation, when i try to perform update, it also throw the validation error, and i am do not know how to make this validation valid for Add New all the time, and valid for Update only when interest name is changed.

    (function ($, kendo) {
        $.extend(true, kendo.ui.validator, {
            rules: { // custom rules
                InterestNamevalidation: function (input, params) {
                    if (input.is("[name='InterestName']") && input.val() != "") {
                        var dataSource = $("#Customer").data("kendoGrid").dataSource;
                        var data = dataSource.data();

                        for (var i = 1; i < data.length; i++) {
                            if ($.trim(input.val().toLowerCase()) == $.trim(data[i].InterestName.toLowerCase())) {
                                input.attr("data-InterestNamevalidation-msg", "InterestName should be unique");
                                return false;

                            }
                        }
                    }
                    return true;
                }
            }
        });
    })(jQuery, kendo);

Georgi Krustev
Telerik team
 answered on 23 May 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
ScrollView
Switch
TextArea
BulletChart
Licensing
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
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?