Telerik Forums
Kendo UI for jQuery Forum
1 answer
2.2K+ views
Hi,

I am trying to programmatically select a row in a Grid depending on some dataItem value. My current approach is to loop through the rows in the DataBound event handler. So far I can find the row, but when I try to select it by using addClass("k-state-selectable") I get a "Object doesn't support this method or property" error.
Here is my code:

function gServices_DataBound(e) {
try {
var servicesGrid = $("#gServices").data("kendoGrid");
if (servicesGrid) {
var selServiceName = '@ViewData["SelServiceName"]';
if (selServiceName) {
// loop thorugh grid rows and select the service with that name
$("#gServices tr").each(function () {
var di = servicesGrid.data(this);
if (di.Name == selServiceName) {
// found the dataItem
// => select it
$(this).addClass("k-state-selected");
}
});
}
}
}
catch (ex) {
alert('gServices_DataBound: Exception: ' + ex.message);
}
}

Any ideas how I can loop through the set of rows and select the one I want programmatically?

Regards
Sven
Nikolay Rusev
Telerik team
 answered on 21 Jun 2013
1 answer
633 views
Do you have any examples of having a upload control in each row of a grid used in the following way:

@(Html.Kendo().Grid<RepairModel>()
.Name("RepairGrid_#=Id#")
.ToolBar(toolBar => toolBar.Create())
.Columns(columns =>
{
columns.ForeignKey(e => e.Type, (System.Collections.IEnumerable)ViewData["RepairTypes"], "Id", "Name")
.Title("Type");
columns.Bound(r => r.Cost);
columns.Bound(r => r.RepairDate);
columns.Bound(r => r.Description);
columns.Bound(r => r.Mileage);
columns.Bound(r => r.RepairLocation);
columns.Command(commands =>
{
commands.Edit().Text("Edit");
commands.Destroy().Text("Delete");
}).Title("Actions");
})
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("grid_error"))
.ServerOperation(false)
.PageSize(100)
.Read(read => read.Action("GetRepairs", "Equipment", new { equipmentId = "#=Id#" }))
.Create(create => create.Action("CreateRepair", "Equipment", new { equipmentId = "#=Id#" }))
.Update("UpdateRepair", "Equipment")
.Destroy("DestroyRepair", "Equipment")
//.Group(g => g.Add(gi => gi.Type))
.Sort(g =>
{
g.Add(gi => gi.Type);
g.Add(gi => gi.RepairDate);
})
.Model(model =>
{
model.Id(m => m.Equipment);
model.Field(m => m.Id).DefaultValue(new Guid());
model.Field(m => m.Equipment).DefaultValue(new Guid());
model.Field(m => m.Type).Editable(true).DefaultValue(((List<RepairTypeModel>)ViewData["RepairTypes"]).Any() ? ((List<RepairTypeModel>)ViewData["RepairTypes"])[0].Id : Guid.Empty);
})
)
.Pageable()
.Sortable()
.Groupable()
.ToClientTemplate())

Thanks,

Billy Jacobs
Petur Subev
Telerik team
 answered on 20 Jun 2013
2 answers
181 views
I am currently evaluating these controls for use with our Hot
Towel/SPA-based application. I am attempting to display a drop down list
with data from our backend. I've attempted to do this with ComboxBox
and DropDownList, and both controls give me a "SCRIPT28: Out of stack
space" error.

I saw one post that said this was due to an older
version of jquery, but I'm using 1.9.1. The data is returned as a JSON
array. I set up the control in the viewAttached function:

function viewAttached(view) {
 
    $('#warehouseId').kendoDropDownList({
        autoBind: false,
        dataTextField: 'WHNAME',
        dataValueField: 'HOUSEO'
 
    });
Then in the same function, I retrieve the data:
aplusAdapter.getWarehouses(0, false, function (warehouseData) {
    //var ds = new kendo.data.DataSource({ data: warehouseData });
    var ddList = $('#warehouseId').data('kendoDropDownList');
    ddList.setDataSource(warehouseData);
    ddList.refresh();
 
});
warehouseData comes back from the controller, and contains valid data, including the WHNAME and HOUSEO fields. The dropdown list control appears to be empty. When I click on it, I get the spinning progress indicator, and the SCRIPT28 error appears. In Firefox, I get a "too much recursion" error.

What am I missing?
Petur Subev
Telerik team
 answered on 20 Jun 2013
9 answers
237 views
Hello Atanas,

this is a new post, describing the problem that we started to talk about in the "definition file for Typescript" thread.

Create a simple Typescript file test1.ts and compile for AMD
export var NAME = "mike";
Create another Typescript file test2.ts with a shortened version of your code. It compiles perfectly.
/// <reference path="kendo.all.d.ts" />
 
module kendo.data.binders {
    export class custom extends Binder {
      constructor(element: Element, bindings: { [key: string]: Binding; }, options?: any) {
         super(element, bindings, options);
      }
   }
 }
Now create another Typescript file test3.ts. Regarding your code it is the same as test2. It additionally imports test1.
/// <reference path="../dts/kendo.all.d.ts" />
 
import T1 = module("test1");
 
module kendo.data.binders {
   export class custom extends Binder {
      constructor(element: Element, bindings: { [key: string]: Binding; }, options?: any) {
         super(element, bindings, options);
      }
   }
}
Now there are problems, not being able to find Binder, Binding, etc.

Michael G. Schneider
Atanas Korchev
Telerik team
 answered on 20 Jun 2013
1 answer
402 views
Is it possible to change the bar color when a bar is clicked?  If I have 5 orange bars I want to click on one and have it turn blue.  Then if I click a different one the blue one turn orange and the new clicked one turns blue.  Is this possible without having to generate the entire chart?
Iliana Dyankova
Telerik team
 answered on 20 Jun 2013
1 answer
353 views
  Hi All,

How to achieve the grid containing check- box   for selection and textbox  to get input as attached in screen.

so  user will input the value in textbox and selected the row using checkbox and click save button.


I am using MVC4+kendo ui grid.

Dimiter Madjarov
Telerik team
 answered on 20 Jun 2013
46 answers
266 views
When reading the documentation I rather often do not know, what datatypes are expected as parameters or which datatype is returned from a method call. I appreciated, if these details were given in the documentation.

Let me make an example. Look at TreeView expand method. The parameter is described as "nodes Selector". What does this mean? Is it a jQuery selector such as "#tree" or "div.tree"? Or is this an DOM object or maybe a jQuery object? The samples show that probably both a selector or a DOM object can be given to the method. If this is so, I would like to read it in the documentation.

A user might also try to find out about method parameters by looking at the TypeScript definition. There he will find...
class TreeView extends kendo.ui.Widget {
    expand(nodes: string): void;
}
Probably this is not correct, as the samples show that also a DOM object can be expanded.

Michael G. Schneider
Atanas Korchev
Telerik team
 answered on 20 Jun 2013
1 answer
219 views
Before I dig too deep into it, I'd like to know if the following is possible on a menu.

I have a static background I must use, then on top of it I need a flat 1 level hierarchical menu that looks like this:

Canada  England Brazil
Toronto Halifax Vancouver Calgary Montreal

As the use clicks or hovers over a country, the cities appear below and can be selected.

1) Can all the UI elements (borders, shading etc) be removed (I have a background I must use)
2) Can the menu go horizontal as per example above?

Iliana Dyankova
Telerik team
 answered on 20 Jun 2013
12 answers
181 views
There is a weird behavior of the button control when trying to test it on android all other platforms everything works well except when trying to mouse hover or click the button an error will occur "cannot call the method call of undefined in kendo.all.min.js"

The weird thing is if i host the application on an http server the error triggers however if i open it from a local file "file:///" nothing happens it works well.

PS: am using your download demo files , file name is "appearance.html" kendo version is  2013.1.514.

Error Details : Uncaught TypeError: Cannot call method 'call' of undefined kendo.mobile.min.js:10arguments.length.t.(anonymous function)kendo.mobile.min.js:10b.event.dispatchjquery.min.js:3v.handlejquery.min.js:3
Kiril Nikolov
Telerik team
 answered on 20 Jun 2013
5 answers
272 views
Tried to do so in many ways, but it always seems to be attached to the bottom of the list view and scrolled out of view when we have a lot of items.

Any suggestion would be appreciated.
Kiril Nikolov
Telerik team
 answered on 20 Jun 2013
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?