Telerik Forums
Kendo UI for jQuery Forum
1 answer
195 views

Hi 

 

I wonder if anyone could help with an issue i am having with Kendo Multi-selection drop down lists.

i have a button which manually populates the field in the code, however when i try to access the object with jquery it results in the control making a copy of itself

 Many Thanks,

 

My MVC razor code

 <div class="col-md-2">
@Html.Kendo().MultiSelectFor(m => m.SelectedMeasuringPoints).BindTo(Model.MeasuringPoints.Select(x => x.TrimStart('0'))).Placeholder("Select points...").TagTemplate("0000#: data #").HtmlAttributes(new { @ID = "MPMultiSelection" })
</div> 

 

/My javascript

function selectDeselectAllMP() {

       //Get handle for the measuring point multi-selection
        var mpMultiselection = $('#MPMultiSelection').kendoMultiSelect().data("kendoMultiSelect");
    }

Kiril Nikolov
Telerik team
 answered on 01 Jun 2015
1 answer
1.8K+ views

Hi,

I have a Grid with several columns. Two of those columns show a NumericTextbox when in edit mode. How can I set the min/max for those numeric textboxes? 

I tried to use the DataBound event, but at that time, the numeric textboxes won't be showing.

Any other suggestion?

 

Thanks

Kiril Nikolov
Telerik team
 answered on 01 Jun 2015
3 answers
272 views

Hi there,

Is there a way for the date picker to retain focus on invalid input. I have managed to achieve this in the combobox control by calling the focus() method inside the change event if the data entered is rubbish. However the date picker does not have a focus event (or at least not one that works the same as the combo box one).

I wonder if there is another way to achieve this?

Thanks

 

Boyan Dimitrov
Telerik team
 answered on 01 Jun 2015
1 answer
105 views
I have a text area editor for a cell as follows:


function CommentsEditor(container, options) {
    console.log("CommentsEditor!!!");
    console.log(options.field);
    console.log(options);
    $('<textarea rows="4" cols="40" data-bind="value:' + options.field + '">'+ options.model.Comments  +' </textarea>')
    .appendTo(container)
        .kendoEditor();
}

    function ReadEditor(input) {        
           // $('<textarea rows="4" cols="40" ">' + input.Comments + ' </textarea>').kendoEditor(); CANT DO THIS!
 
            return '<textarea rows="4" cols="40" ">' + input.Comments + ' </textarea>';
        }




This works fine when I edit the cell. But how do I make it so that VIEWING the cell looks the same? I want each row, even when it is not being edited, to display a text area.

The problem is I cannot figure out how to get "template:" to do this, as there seems to be no way for me to call the right jquery inside of the template for a field to make it a kendo text area instead of a normal text area. Any ideas?

    { field: "Comments", template: ReadEditor, editor: CommentsEditor, title: "Comments", format: "{0:c}", width: "200px" },
Nikolay Rusev
Telerik team
 answered on 01 Jun 2015
1 answer
52 views
Hi. There.

Can Kendo UI do this?

Left                  |     right

Kendo Grid      |     <div draggable>Item></div>

 
I want to drag right Item and drop to Left Kendo Grid. Is it possible?

Thx in advance.
Alexander Valchev
Telerik team
 answered on 01 Jun 2015
1 answer
85 views

Hi. There.

Can Kendo UI do this?

Left                  |     right

Kendo Grid      |     <div draggable>Item></div>

 
I want to drag right Item and drop to Left Kendo Grid. Is it possible?

Thx in advance.

Alexander Valchev
Telerik team
 answered on 01 Jun 2015
1 answer
130 views

Evaluating Kendo-ui-Grid 

We already have loads of API’S defined and working. We are making a call from angular services via
Rest angular to access WebAPI and the results are being returned as a Data contract object and consumed as a JSON in angular controllers.

I was having a look at the fiddler calls for each Server Side pagination, filtering and sorting with the
demo examples. I see that lots of additional parameters are being appended to the request to get it working, which has to be to get it working.
And the output results are wrapped in an object, including __count and the output wrapped in results object.

For example :--  
A couple of clarifications are needed on observing the below calls in fiddler.

GET
/kendo-ui/service/Northwind.svc/Employees?$callback=jQuery19109150235853157938_1432724185770&%24inlinecount=allpages&%24format=json&%24top=5&%24skip=5

GET
/kendo-ui/service/Northwind.svc/Orders?$callback=jQuery19109928784077055752_1432727010629&%24inlinecount=allpages&%24format=json&%24top=20&%24filter=(OrderID+eq
+10249+and+substringof(%27toms%27%2CShipName)+and+Freight+gt+11)
HTTP/1.1

/kendo-ui/service/Products?callback=jQuery19106439431465696543_1432804943581&_=1432804943582
HTTP/1.1

1)  Is there a way by which we can still use our existing webapi’s just by capturing the skip,  top, format, filters etc from the data of grid and pass it to our
webapi . This would enable us to re-use our Angular js service calls from controller to make a Rest call to webapi.
2) What are the expected fields of data output from the webapi for the kendo grid to work successfully with server side pagination, server side filtering  and
server side sorting.
3) Is it possible, to map data results from our custom webapi to kendo ui grid ?.
4) Can we have more information on the necessity of callback query string input in webapi call
and is it always necessary to have this sent across webapi calls ?. We don’t
understand the practical usage of this.
5)If you don’t have an option to map  custom webapi results to kendo- grid,  It will be great if we can get an code sample on what should the definition of webapi
output’s be to get the grid working successfully.

It will be very much appreciated if we get some code snippets to prove the above things. This would enable us to
promisingly go ahead and buy licenses.
Thanks in advance for your time. It would be very much appreciated, if we get a quick response regarding the same.

Atanas Korchev
Telerik team
 answered on 01 Jun 2015
2 answers
99 views

Hi,

 

Following is my requirement

 1. On load the Gantt is initialized with a default set of tasks called activities

 2. each activities can have one or more child tasks

 3. The child task is added using a Add Task button just below the activity

 4. on click if Add task a new task is added as child to the activity preceeding the Add Task row

 

please find the screen shot attached.

 

I am able to achieve 1 & 3 from a UI perspective

the Add Task row is also a task which is restyled/ retemplated on databound based on a custom task type to remove other task related information and just show an add task link

 I am able to catch the add task click and also get the id of the row but i am not able to add a new task as a child programatically to the above activity

 

These are bits of code i have tried

 

function addTask(adderButtonRowId) {
    var gantt = $("#gantt").data("kendoGantt");
    var task = getNewTask(adderButtonRowId);
    var taskNew = new kendo.data.GanttTask(task);
    gantt.dataSource.add(taskNew);
}

 

However the UI is not rendered as expected. The getNewTask

 method returns a task object with attributes such as parentId, orderId and id set appropriately.

 

Any help appreciated.

Thanks in advance.

Dimitar Terziev
Telerik team
 answered on 01 Jun 2015
1 answer
838 views
I have a nested grid and am having some issues. In my nested grid I need to allow the user to create a new entry. This works perfectly fine if I don't have a  filter for my datasource. If I add one though, when I press "Create Row", nothing happens. No error or message. There is just no new row that is added to the grid. Here is my code:


function detailInit(e) {
      
    var detailRow = e.detailRow;
    console.log("detailRow");
    console.log(e);
    console.log(e.detailRow);
 
 
    detailRow.find(".tabstrip").kendoTabStrip({
        animation: {
            open: { effects: "fadeIn" }
        }
    });
 
    detailRow.find(".AppendLogGrid").kendoGrid({
        dataSource: {
            transport: {
                read: {
                    url: crudServiceBaseUrl + "api/Logging/GetAllLogAppends",
                    dataType: "json"
                },
                update: {
 
                    url: function (data) {
                        console.log("DATA TEST");
                        console.log(data);
                        return crudServiceBaseUrl + "api/Logging/PutLogAppend";
                    },
 
                    dataType: "json",
                    data: function (data) {
                        console.log("returning data in update TEST");
                        console.log(data.models[0]);
                        return data.models[0];
                    },
                    type: "PUT",
                    contentType: "application/json",
 
                },
                destroy: {
                    url: crudServiceBaseUrl + "api/Logging",
                    dataType: "json"
                },
                create: {
                    dataType: "json",
                    type: "POST",
                    contentType: "application/json",
                    url: function (data) {
                        console.log("INSIDE CREATE URL");
                        console.log(data);
                        console.log(data.models[0]);
                        return crudServiceBaseUrl + "api/Logging/PostLogAppend?ParentLogID=" + e.data.id;
                    },
                    data: function (data) {
                        console.log("CREATING TEST DATA");
                        console.log(data.models[0]);
 
                        return data.models[0];
                    }
 
                },
 
                parameterMap: function (model, operation) {
                    if (operation !== "read" && model) {
                        return kendo.stringify(model);
                    } else {
                        return kendo.stringify(model);
                    }
                }
            },
            // filter: { field: "LOG_FK", operator: "eq", value: e.data.id }, THIS IS THE ISSUE!!!!!
            batch: true,
            pageSize: 20,
            schema: {
                data: function (data) { 
                    console.log("Log append return data:");
                    console.log(data);
                    console.log(e.data);
                    console.log(e.data.$id);
                    return data || [];
                },
                model: {
                    id: "Id",
                    fields: {
                        Id: {
                            editable: false,
                            nullable: false,
                            type: "number"
                        },
 
                        Comments: { type: "string" },
                        DateAppended: { type: "date" },
                        Type: { type: "string" },
                        LOG_FK: { type: "number" }
 
                    }
                }
            }
 
        },
         
        scrollable: false,
        sortable: true,
        pageable: true,
        toolbar: ["create"],
        editable: "inline",
        columns: [
            { field: "Id", width: "110px" },
            { field: "Comments", title: "Comments", width: "110px" },            
              { command: ["edit", "destroy"], title: " ", width: "250px" }
        ]
    });
 
 
}
 
$("#IncidentLoggingGrid").kendoGrid({
    dataSource: LoggingDS,
 
    columns: [         
        { field: "Comments", template: "<textarea rows='4' cols='40'>  </textarea>  ", title: "Comments", format: "{0:c}", width: "200px" },   
 
        { command: ["edit", "destroy"], title: " ", width: "250px" }
    ],
    detailTemplate: kendo.template($("#AppendLogGridTemplate").html()),
    detailInit: detailInit,
    dataBound: function () {
        this.expandRow(this.tbody.find("tr.k-master-row").first());
    },
    toolbar: ["create"],
    editable: "inline",
    pageable: true
 
});


I don't know what else to try. Thanks for any help.
Vladimir Iliev
Telerik team
 answered on 01 Jun 2015
2 answers
698 views
Below you can see the pertinent code.  when I try to append a new node in the tree it's always "undefined" when I check $("#appendNodeText").val() it does have the correct value.  What am I missing?


@(Html.Kendo().TreeView()
                    .Name("treeview")
        //.TemplateId("treeview-template")
                                .HtmlAttributes(new { @class = "col-md-6", id = "treeview" })

                    .DataTextField("Title")
                    .DataImageUrlField("Image")
                    .DataSource(dataSource => dataSource
                        .Read(read => read
                            .Action("Categories", "DisplayArticle")
                        )
                    )
                    .Events(events => events
                    .Select("onSelect")
                    )
)

    <li>
        <input id="appendNodeText" value="Node" class="k-textbox" />
        <button class="k-button" id="appendNodeToSelected">Append node</button>
    </li>




    var treeview = $("#treeview").data("kendoTreeView"),
        handleTextBox = function (callback) {
            return function (e) {
                if (e.type != "keypress" || kendo.keys.ENTER == e.keyCode) {
                    callback(e);
                }
            };
        };


        var append = handleTextBox(function (e) {
            //var treeview = $("#treeview").data("kendoTreeView")
            var selectedNode = treeview.select();

            // passing a falsy value as the second append() parameter
            // will append the new node to the root group
            if (selectedNode.length == 0) {
                selectedNode = null;
            }
            
            treeview.append({
                Name: $("#appendNodeText").val(),
                id: $("#appendNodeText").val(),
                text: $("#appendNodeText").val()
            }, selectedNode);
        });

        $("#appendNodeToSelected").click(append);
ali
Top achievements
Rank 1
 answered on 31 May 2015
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
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?