Telerik Forums
Kendo UI for jQuery Forum
1 answer
286 views
I have a Kendo UI Grid that has n-levels of hierarchy that's based on this solution here: http://stackoverflow.com/questions/24004905/kendo-ui-grid-multi-level-hierarchy-n-levels-of-hierarchy . I have buttons inside the rows that need to update some table data, but every time i make it refresh() or read(), the table closes the hierarchy.here is the update function, if needed:

function updateStatus(uN, tId, isSub, tAct, lN) {
    $.ajax({
        url: "supersecretwebsite.com",
        type: "POST",
            success: function (a) {
                $("#LoanTasksTop").data("kendoGrid").dataSource.read();
                $("#LoanTasksTop").data("kendoGrid").refresh();
            }
     });
}
Alex Gyoshev
Telerik team
 answered on 17 Oct 2014
1 answer
368 views
I have a requirement to display separators within the DropDownList widget. For example, I'd like to list all states in the U.S., followed by all Canadian provinces. These 2 collections should be separated with a line, and that line should not be selectable. Is this possible using a template with the DropDownList widget?
Alexander Popov
Telerik team
 answered on 17 Oct 2014
2 answers
395 views
Hi, I'm using the Kendo DropDownList with server side validation.  When submitting my form the first time, the server validation fires and the expected error message appears by the dropdown control.  However, if I submit form again, the DropDownList actually disappears during postback, doesn't bind to model, and is not in Request.Form collection.

Any ideas?  I've seen posts elsewhere but no replies (see below).

http://stackoverflow.com/questions/16633498/jquery-validate-hides-kendo-ui-controls
http://www.codeproject.com/Questions/753507/Kendo-combobox-control-disappears-while-clicking-o
Bob
Top achievements
Rank 1
 answered on 17 Oct 2014
3 answers
792 views
Hi,

I have to prevent user form editing a row. I am using a custom  validation on edit event. I can validate and closeCell but I am having difficulties with  providing some feedback to user.
My grid also contains custom edit drop down, I am also having difficulties with displaying feedback for that field. 

Code example http://dojo.telerik.com/odeKI/2

I would appreciate any suggestions
Alexander Popov
Telerik team
 answered on 17 Oct 2014
1 answer
249 views
Since the problem is quite complex, I have included a sample project in attachment to reproduce the problem. I had to leave out the downloaded NuGet packages, Content/kendo and Scripts/kendo to get the zip under 2 Mb. I thrust you can get it working again. If not, it is basically an MVC5 project with KendoUI added, a model, and some changes to the HomeController and its _Layout and Index views.

Due to the combination of Kendo UI NumericTextBox, jquery validation, server-side model validation, the numeric text box disapears.

Steps to reproduce with solution in attachment:
- Run the project ;-)
- Click Post
- Empty the non-Telerik textbox
- Click Post again
- Watch the NumericTextBox disappear.

My analysis so far:
- In the first postback, client-side validation doesn't find an error, but server side validation does (the NumericTextBox is required)
- Then, with the second postback, client-side validation does find an error with the non-Telerik textbox, but not with the NumericTextBox
- jQuery validation empties all spans with the class "input-validation-error", where it can no longer find a validation error
- the initialised NumericTextBox fits this description, so the span is emptied, making the NumericTextBox disappear.

My questions:
- Why doesn't the "Required" error get caught on client-side validation?
- How do we keep the described side effect from happening for cases where we verify certain business rules on server-side only?
Georgi Krustev
Telerik team
 answered on 17 Oct 2014
1 answer
249 views
I would like to get the global index of a given Grid row in order to implement a multi-selection across a grid with virtual scrolling enable.  It's easy to get the index within the displayed rows:

var kendoGrid = $("#myGrid").data("kendoGrid");
var index = kendoGrid.items().index(kendoGrid.select());


At this point, to logic would be to use the page number / page size to determine what is the global index of the selected row.

//Pages are base 1
index += (kendoGrid.dataSource.page() - 1) * kendoGrid.dataSource.pageSize();


However, this ain't working with the Kendo grid (except for the first page) as the grid is displaying rows from page previously loaded.

Example: You have records from 1 to 200 with a page size of 100. When you'll scroll down to the record #100, the dataBound grid event will be triggered and you'll be able to notice the dataSource page has changed from 1 to 2.

You'll also notice some rows from page 1 are still visible and their index will be calculated as a page 2 element.

For instance, the record #96 has the index 95 as long as the grid remain on page 1. When you'll switch to page 2, the record #96 will be displayed (as the first item). At this point, index returned by the grid for that row will be 0. If you apply the page number / size rule above, you'll end up with the index 100.

Is there any solution that doesn't involve a row index calculated on the server side?

Note If we had a PK column, it could be possible to use it to build a list of index, but we don't always have a PK column so this isn't an option.
Petur Subev
Telerik team
 answered on 17 Oct 2014
1 answer
82 views
My code runs without errors, however when I run the Kendo Linter in Chrome (great tool btw), I get the message:

Unknown option: CountryName

which refers to the "optionLabel: { CountryName" in the following code:

$("#recent-country-filter").kendoDropDownList({
    dataTextField: "CountryName",
    dataValueField: "CountryId",
    dataSource: countryDs,
    value: "1",
    optionLabel: {
        CountryName: "Any country",
        CountryId: "0"
    },

Just curious. Is the code not correct?
Mihai
Telerik team
 answered on 17 Oct 2014
1 answer
129 views
Is it possible to keep the 'old' content of a view with data-reload="true" when hitting the back button ?
Petyo
Telerik team
 answered on 17 Oct 2014
3 answers
778 views
I'm using a basic Kendo Grid with a WebApi data source. The calls to Create, Read and Update work just fine, even with additional data through .Data(), using a JavaScript function. However, when I try to do the same for the Delete call, it won't reach the method. The problem is, our DBA has not created a unique key for the rows I'm working with - I only have a composite key, which is why I need two values. Note that when I remove the additional parameter and additional data, the Delete action is called.

How do I achieve this?

The WebApi Delete method:
1.public void Delete(int id, long receiptId)
2.{
3.    service.Delete(receiptId, id);
4.}

The Destroy() on the DataSource:
1..Destroy(c =>
2.    c.Url(Url.HttpRouteUrl(
3.        "DefaultApi",
4.        new { controller = "ReceiptLines",
5.        id = "{0}" })
6.    ).Data("getSelectedReceiptId"))

And finally, the JavaScript getSelectedReceiptId function:
01.function getSelectedOntvangstId() {
02.    var gridOntvangsten = $("#GridOntvangsten").data("kendoGrid");
03.    var selectedRow = gridOntvangsten.select();
04.    var data = gridOntvangsten.dataItem(selectedRow);
05.    var obj = {
06.        OntvangstId: 0
07.    };
08. 
09.    if (data !== null) {
10.        obj.OntvangstId = data.OntvangstId;
11.    }
12. 
13.    return obj;
14.}
Kiril Nikolov
Telerik team
 answered on 17 Oct 2014
1 answer
167 views
Hi,

I have a list of items in a dropdownlist.  Each item contains 3 properties.  The name, the acronym, and the Id.  I'm currently using the name and Id which works perfectly fine.

As the list is long, it's typical for a user to open the dropdownlist and start typing to find the item they are after.  Our users like to search/type the acronym, not the full name.  So because we only show the full name in the dropdown text, typing the acronym usually does not get you to the correct item.

How can I display the full name, but type-ahead on the acronym?

Thanks!
Daniel
Telerik team
 answered on 17 Oct 2014
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?