Telerik Forums
Kendo UI for jQuery Forum
1 answer
10.3K+ views
HI, I create a Grid with a custom local dataSource. I give the grid un model and when initially created and displayed all work good.

If I whant to replace date in the datasource without change de model, i use:
grid.dataSource.data(collTemp);
collTemp containt array of objects in the same way i did at the creation phase.

The grid relaod the data OK, but I lost all my formating information (like the $ on the price columns). When I click on the price for edition I can see the $ sign breifelly appear.

When the user click on the "refresh" button, The initial old data is repopulated.

How I can change the "real" internal data without recreating all the datasource, Model and columns information? 

thanks
Tsvetina
Telerik team
 answered on 12 Sep 2018
1 answer
720 views
I have to upload 5 (min and max) .txt  files at a time, I'm trying to validate throught JS the minium or max number of files and send a message, but with the validation events that are there i can't actually do that. Is there any other way? Or a way to create a custom validation for uploading files?
Neli
Telerik team
 answered on 12 Sep 2018
3 answers
406 views

Hello.

I want to create grid where in some of the columns would be a datepicker just to select the time.

 

Here is a data which I recive (1 record sample) : {shopID: 16, scheduleDay: "2000-01-01T00:00:00", shopWorkingHourID: 1,…}

 

Here is my model schema :

                schema: {
                    model: {
                        fields: {
                            shopID: "shopID",
                            scheduleDay: "scheduleDay",
                            workStartHour: "workStartHour",
                            workEndHour: "workEndHour",
                        }
                    }
                }

 

Here is my column configuration :

                columns: [
                    {
                        field: "shopID"
                    },
                    {
                        field: "scheduleDay",
                        format: "{0:yyyy/MM/dd}"
                    },
                    {
                        
                        field: "workStartHour",
                        editor: function (container, options) {

                           console.log('here');
                            var input = $("<input/>");
                            input.attr("workStartHour", options.model.workStartHour);

                            input.appendTo(container);

                            input.kendoTimePicker({});
                        },
                        format:"{0:HH:mm}",
                    }]

Time is displayed correctly but I cannot pick the time, even picker isn't shown.

 

Some crucial information

* I've tried convert data I receive to new Date

* I've included scripts corectly

* I don't get any errors

 

I'll take any advice how to make this work.

Viktor Tachev
Telerik team
 answered on 12 Sep 2018
1 answer
165 views

I'm using kendo ui with mvc pivto grid local_flat_data_binding. I have problem in the chrome's console saying that 'kendoPivotConfigurator is not a function'
Here is my layout's code

@Scripts.Render("~/bundles/jquery")<br>   
@Scripts.Render("~/bundles/jqueryval")<br>   <br>   
@Styles.Render("~/Content/css")<br>   
@Scripts.Render("~/bundles/modernizr")<br>   
<br>  <br>   
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2018.2.620/styles/kendo.bootstrap.min.css" /><br><br>   
<script src="https://kendo.cdn.telerik.com/2018.2.620/js/jszip.min.js"></script><br><br>   

 

my html page and the controller are exactly like the examples sample.

Thank you

Ahmad
Top achievements
Rank 1
 answered on 12 Sep 2018
4 answers
256 views
Hi Forum,

I want to ask , can we interpolate the line based on two points. So the line to start from minus infinity  crossing the two points and goes to plus infinity. In my plunk case to start from zero pass trough the data I am giving and go to plus infinity. (something like Interpolation of missing values.) 

http://plnkr.co/edit/boqUCbUHXcpSHXHNKvcE?p=preview

Thanks in advance.
Iliyan
Top achievements
Rank 1
 answered on 12 Sep 2018
3 answers
1.6K+ views
Hello,

Is there a way to get the cursor position in the kendo Editor? I want to give the user the option to add a kind of placeholders to the text in the editor. To do this he selects a variable name from a list, the selected variable will be added to the text.

The simple way is to just append it to the text in the editor;
    var body_text = $("[id$='_txtMailBody']").data("kendoEditor").value();
    body_text += " %" + selected_item.id + "% ";
    $("[id$='_txtMailBody']").data("kendoEditor").value(body_text);


A better way is to find the cursor position an then insert the selected item to the text. But how can I do this?

Thank you for your help.
Sijeesh
Top achievements
Rank 1
Veteran
 answered on 11 Sep 2018
6 answers
991 views

Hi, 

how can I set the first day of the week used by the Kendo UI DatePicker in an Angular 2/4 project?

Thanks,

Mike

Dimiter Topalov
Telerik team
 answered on 11 Sep 2018
3 answers
939 views
Hi All,
           I am using inline edit in kendo grid with ForeignKey in my MVC3 Application. The record was updated successfully in database,but i want to displayed message like "The record was updated successfully" in my View. How to do that. Please share me if you have information about this.

Please find my edit Kendo grid Edit event


  [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult CommandParameterTypeUpdate([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<CommandParameterModel> commandParameters)
        {
          
           ///Update to database   
            return Json(ModelState.ToDataSourceResult());
        }

I want to displayed "The record was updated successfully" message in my view from this edit event.

Thanks
Parthasarathi M
Viktor Tachev
Telerik team
 answered on 11 Sep 2018
1 answer
385 views

when I lock columns to make them static this causes my grid to shrink. I don't think resize function is working. Funny part is when I inspect my page on browser and close the dev tools in chrome grid resizes it and it turns into normal.

 

here is my script;

$(document).ready(function() {
                        $("#berth-grid").kendoGrid({
                            dataSource: {
                                type: "json",
                                transport: {
                                    read: {
                                        url: "@Html.Raw(Url.Action("BerthList", "PortGuideAdmin"))",
                                        type: "POST",
                                        dataType: "json",
                                        data: function() {
                                            var data = {
                                                PortId: '@(Model.Id)'
                                            };
                                            addAntiForgeryToken(data);
                                            return data;
                                        }
                                    },
                                    update: {
                                        url: "@Html.Raw(Url.Action("BerthUpdate", "PortGuideAdmin"))",
                                        type: "POST",
                                        dataType: "json",
                                        data: addAntiForgeryToken
                                    },
                                    destroy: {
                                        url: "@Html.Raw(Url.Action("BerthDelete", "PortGuideAdmin"))",
                                        type: "POST",
                                        dataType: "json",
                                        data: addAntiForgeryToken
                                    }
                                },
                                schema: {
                                    data: "Data",
                                    total: "Total",
                                    errors: "Errors",
                                    model: {
                                        id: "Id",
                                        fields: {
                                            PortId: { editable: false, type: "number" },
                                            TerminalId: { editable: false, type: "number" },
                                            TerminalName: { editable: true, type: "string" },
                                            BerthName: { editable: true, type: "string" },
                                            BerthNo: { editable: true, type: "string" },
                                            BerthOperator: { editable: true, type: "string" },
                                            BerthType: { editable: true, type: "string" },
                                            TerminalType: { editable: true, type: "string" },
                                            Latitude: { editable: true, type: "number" },
                                            Longitude: { editable: true, type: "number" }
                                        }
                                    }
                                },
                                requestEnd: function(e) {
                                    if (e.type == "update") {
                                        this.read();
                                    }
                                },
                                error: function(e) {
                                    display_kendoui_grid_error(e);
                                    // Cancel the changes
                                    this.cancelChanges();
                                },
                                pageSize: @(Model.PortBerthSearchModel.PageSize),
                                serverPaging: true,
                                serverFiltering: true,
                                serverSorting: true
                            },
                            pageable: {
                                refresh: true,
                                pageSizes: [@(Model.PortBerthSearchModel.AvailablePageSizes)],
                                @await Html.PartialAsync("_GridPagerMessages")
                            },
                            editable: {
                                confirmation: "@T("Admin.Common.DeleteConfirmation")",
                                mode: "inline"
                            },
                            height: 400,
                            resizable: true,
                            columns: [
                                {
                                    field: "TerminalId",                                  
                                    title: "Terminal Id",
                                    locked: true,
                                    width: 200
                                }, {
                                    field: "TerminalName",                                  
                                    title: "Terminal Name",
                                    //locked: true,
                                    width: 200
                                },
                                {
                                    field: "BerthName",
                                    width: 200,
                                    title: "Berth Name",
                                    //locked: true
                                },
                                {
                                    field: "BerthNo",
                                    width: 200,
                                    title: "Berth No"
                                },
                                {
                                    field: "BerthOperator",
                                    width: 200,
                                    title: "Berth Operator"
                                },
                                {
                                    field: "BerthType",
                                    width: 200,
                                    title: "Berth Type"
                                },
                                {
                                    field: "TerminalType",
                                    width: 200,
                                    title: "Terminal Type"
                                },
                                {
                                    field: "Latitude",
                                    width: 200,
                                    title: "Latitude"
                                },
                                {
                                    field: "Longitude",
                                    width: 200,
                                    title: "Longitude"
                                },
                                {
                                command: [
                                {
                                    name: "edit",
                                    text: {
                                        edit: "@T("Admin.Common.Edit")",
                                        update: "@T("Admin.Common.Update")",
                                        cancel: "@T("Admin.Common.Cancel")"
                                    }
                                }, {
                                    name: "destroy",
                                    text: "@T("Admin.Common.Delete")"
                                }
                                ],
                                width: 200
                            }
                            ]
                        });
                    });
Stefan
Telerik team
 answered on 11 Sep 2018
6 answers
972 views

I'm using MVC and I have a dropdown list that pulls from the rows in the database and when an option from the dropdown list is selected, I want it to populate additional fields on the View that are other columns in the row on the database.

My View with the dropdown and the field I want populated.
 <div class="group">
        @Html.LabelFor(model => model.TransactionTemplateName, htmlAttributes: new { @class = "window-label-left" })
        @(Html.Kendo().DropDownList()
                                                                                .Name("TransactionTemplateName")
                                                                                .DataTextField("TransactionTemplateName")
                                                                                .DataValueField("ID")
                                                                                 .Filter("contains")
                                                                                .Events(e => e.Change("onChange"))
                                                                                .DataSource(source =>
                                                                                {

                                                                                    source.Read(read =>
                                                                                    {
                                                                                        read.Action("GetTransactionTemplate", "Transactions");
                                                                                    });
                                                                                })

                                                                                    .HtmlAttributes(new { style = "width: 50%" })
        )


    </div>
   
    <div class="group">
        @Html.LabelFor(model => model.DESCRIPTION, htmlAttributes: new { @class = "window-label-left" })

        @Html.EditorFor(model => model.DESCRIPTION, new { htmlAttributes = new { @class = "window-text" } })

        @Html.ValidationMessageFor(model => model.DESCRIPTION, "", new { @class = "text-danger" })

    </div>

My method in the Controller to call the dropdown list and hopefully the additional column

public JsonResult GetTransactionTemplate(string text)
        {
            var northwind = new TreasuryEntities();


            var products = northwind.TransactionTemplates.Select(product => new TransactionViewModel
            {
                ID = product.ID,
                TransactionTemplateName = product.TEMPLATE_ID,
                DESCRIPTION = product.DESCRIPTION

            });

            if (!string.IsNullOrEmpty(text))
            {
                products = products.Where(p => p.TransactionTemplateName.Contains(text));
            }

            return Json(products, JsonRequestBehavior.AllowGet);
        }
      

 

I'm having trouble with the script needed to populate the other fields. 

 function onChange() {

        $("#TransactionTemplateName").change(function () {
            $("#ID").val(ID);
            $("#DESCRIPTION").prop('readonly', false);
            $("#DESCRIPTION").val();
            $("#DESCRIPTION").prop('readonly', true);
        })
    }

Tyler
Top achievements
Rank 1
 answered on 10 Sep 2018
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
Drag and Drop
Map
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
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?