Telerik Forums
Kendo UI for jQuery Forum
4 answers
1.7K+ views
I'd like to know if it is possible to get the elementId during an event?

Example.  I have a slider control that I'd like to grab the id of the slider and then update the correlating text control.

e.g.

Text:  <input id="panelBarColor-bg"  ......
Slider <input id="panelBarColor" .......

So on slide I could update the text control with the value of the panelBar.
The reason I ask is I have a lot of sliders and it would be great to have one handler based on the Class instead of several based on the Id.
If I can grabbed the sliders id that triggered the event I can parse it to update the text.  I've done this with other standard controls.

I've looked through the docs, but either I am missing how to do that, I am still not as well versed in Jquery as I need to be (more than likely), or it is not possible right now.

thanks a mil!
Damon
Stephen
Top achievements
Rank 2
 answered on 22 May 2015
1 answer
180 views

Hello,

Here: http://dojo.telerik.com/IkEna, I changed the editable config from true to "popup" and, when attempting to add a new record, everytime the popup window displays it just disappears.  It seems there is a timing issue with the display of the kendo.ui.Window object and either the execution of the ws request or the invocation of the success callback, which is options.success invoked as

callback(result);

Not sure there ... any hints? 

Dan

Alexander Popov
Telerik team
 answered on 22 May 2015
2 answers
1.4K+ views

I'm trying to disable sorting and filtering on a column in a grid that I created from a <table></table>. Here is the table:

<table id="vehicleList">
    <colgroup>
        <col style="width: 115px;" />
        <col style="width: 185px;" />
        <col style="width: 135px;" />
        <col style="width: 145px;" />
        <col style="width: auto;" />
        <col style="width: 255px;" />
    </colgroup>
    <thead>
        <tr>
            <th data-field="Number">Number</th>
            <th data-field="VehicleType">Type</th>
            <th data-field="LicensePlate">License</th>
            <th data-field="VIN">VIN</th>
            <th data-field="Pool">Pool</th>
            <th data-field="Buttons"> </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var v in Model)
        {
            <tr>
                <td>@v.Number</td>
                <td>@v.VehicleType.Name</td>
                <td>@v.LicensePlate</td>
                <td>@v.VIN</td>
                <td>@v.Pool.Description</td>
                <td>
                    <input type="button" class="roundedButton blue updateVehicle" value="Update" data-vehicleid="@v.VehicleId" style="z-index: 999;" />
                    <input type="button" class="roundedButton activateVehicle @(v.Active ? "orange" : "green")" value="@(v.Active ? "Deactivate" : "Activate")" data-vehicleid="@v.VehicleId" />
                    <input type="button" class="roundedButton red deleteVehicle" value="Delete" data-vehicleid="@v.VehicleId" />
                </td>
            </tr>
        }
    </tbody>
</table>

And here is my code to create the Kendo Grid:

$("#vehicleList").kendoGrid({
            pageable: {
                pageSizes: [5, 10, 25, 50, 100],
                pageSize: 5,
                buttonCount: 5
            },
            filterable: true,
            sortable: true
        });

I tried this (found a thread on StackOverflow), but the columnsConfig variable is undefined so it's not working:

var grid = $("#vehicleList").data("kendoGrid");
var columnsConfig = grid.options.columns;
columnsConfig[5].filterable = false;

columnsConfig[5].sortable = false;

grid.setOptions({ columns: columnsConfig });

Darryl
Top achievements
Rank 1
 answered on 22 May 2015
1 answer
120 views

Hi,

 

What would be the best approach to sorting a data source and only displaying the top 10 and the bottom 10 of the data source (json call) for a bar chart using MVVM?

 

Thanks,

Julien

Boyan Dimitrov
Telerik team
 answered on 22 May 2015
3 answers
125 views

Hi there.

Now I'm using the Kendo UI ver.2015.1429 and found the issue which does not show "data-placeholder" value on combobox at very first time when combobox is loaded.

But once I try to select any value from combobox it showed me "data-placeholder" value. So is there anyway to fix this problem? Or there will be new release soon?

you can reproduce this issue on combobox demo page.

Thanks.

Jin

Georgi Krustev
Telerik team
 answered on 22 May 2015
3 answers
2.7K+ views

Hello,

I have the following code that works fine in javascript.

kendo.drawing.drawDOM($(".content-wrapper"))

but when I switched over to Typescript, I get the following error.

Argument of type 'JQuery' is not assignable to parameter of type 'HTMLElement'

 

HTMLElement is defined in ..\typescript\kendo.all.d.ts as

interface HTMLElement {
    kendoBindingTarget: kendo.data.BindingTarget;
}

 BindingTarget is defined as

    class BindingTarget {
        target: any;
        options: any;
        source: any;
    }

 

How do I convert the following code to typescript?

kendo.drawing.drawDOM($(".content-wrapper"))

 

 

 

Kiril Nikolov
Telerik team
 answered on 22 May 2015
5 answers
113 views

Hello,

Our Delete API uses a POST operation and accepts just the key of the event to be deleted. I found a post which demonstrates modifying the payload in the transport.parameterMap during the "destroy" operation and this works just fine except an exception occurs after the successful call (see attached).

I suspect it is because I am not returning a true "event" body, like occurs for the create/update operations.

Would it be better to hook the "remove" event, make my own Ajax call, and then return preventDefault()? If so, what is the recommended approach for removing the event from the Scheduler without calling removeEvent() (which itself ends up provoking the remove() function).

Thanks.

 Sam.

Kiril Nikolov
Telerik team
 answered on 22 May 2015
4 answers
130 views
Here is my View:
<div class="form-group">
            @Html.LabelFor(model => model.locationCode, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => model.locationCode, new SelectList(Model.Locations))
                @Html.ValidationMessageFor(model => model.locationCode)
            </div>
        </div>
 
        <div class="form-group">
            @Html.LabelFor(model => model.loadType, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => model.loadType, new SelectList(Model.LoadTypes))
                @Html.ValidationMessageFor(model => model.loadType)
            </div>
        </div>
 
        <div class="form-group">
            @Html.LabelFor(model => model.loadDescrip, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @(Html.Kendo().ComboBox()
                        .Name("loadDescription")
                        .Filter(FilterType.Contains)
                        .DataSource(source => {
                            source.Read(read =>
                            {
                                read.Action("GetCascadeDocumentNumbers", "DockDoor")
                                    .Data("filterLoadDescription");
                            })
                          .ServerFiltering(true);
                        })
                        .Enable(false)
                        .AutoBind(false)
                        .CascadeFrom("loadType")
                        )
                <script>
                    function filterLoadDescription(){
                        return {
                            locCode: $("#locationCode").val(),
                            loadType: $("#loadType").val(),
                            docNumFilter: $("#loadDescription").data("kendoComboBox").input.val()
                        };
                    }
                </script>
                @Html.ValidationMessageFor(model => model.loadDescrip)
            </div>
        </div>


Here is the method in my Controller:
public JsonResult GetCascadeDocumentNumbers(string locCode, string loadType, string docNumFilter)
       {
           var docNums = db.GetCurrentDocumentNumbers(locCode, loadType).AsQueryable();
 
           if (!string.IsNullOrWhiteSpace(docNumFilter))
           {
               docNums = docNums.Where(x => x.Contains(docNumFilter));
           }
 
           return Json(docNums.Select(x => new {DocCode = x}), JsonRequestBehavior.AllowGet);
       }


What am I doing wrong that this is not being called?
Georgi Krustev
Telerik team
 answered on 22 May 2015
1 answer
73 views

In the demo here : http://demos.telerik.com/kendo-ui/grid/virtualization-remote-data and in other tests I have done in my app, it seems that the request to load data from the remote datasource is done two times (or sometimes just one time as expected).

The problem with this behavior is that my app has to perform a big query in the database two times instead of one, which is bad for performance.

Is there any reason why this is done this way or is this a bug ?

I have tested on OSX with Safari, Firefox Dev and Opera Dev.

Thanks for your help.

Dimo
Telerik team
 answered on 22 May 2015
1 answer
1.8K+ views

Hi,

One of the columns is an ID of a record. Id has a certain format something like: XXXX-XXX-1 etc.

 When sorting on this column values show as:

XXXX-XXX-1

XXXX-XXX-10

XXXX-XXX-2

XXXX-XXX-3

...

 

Is there a way to properly sort such that -10 appears after?

 

Thanks

Plamen Lazarov
Telerik team
 answered on 21 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?