Telerik Forums
Kendo UI for jQuery Forum
1 answer
235 views
Is there a way to get the row number for the row on which the select button was clicked, i think we should be able to get it from event arguments. I tried looking through the object inspector in visual studio for the javascript event object "e" for the row number but was unable to find it. We are currently using kendo UI, asp.net mvc 4.0 and kendo MVVM. Please advise, the vent is getting fired but i cannot get the row number

//column definition for button
{ "command":{"text" : "Details",  "name":"selectClicked", click:inactiveDistrictVM.selectClicked } },

//the event delaraion
editDistricts: function (e) {
            debugger;
            var elem = this.get("districtsSource").at(0);//we need to replace the 0 with row number 
}
Vladimir Iliev
Telerik team
 answered on 21 Jun 2013
1 answer
78 views
Hi,
I am trying to use a treeview in a layout page.
I am going to load the tv from a database call (LINQ).
Since there is no controller for the layout page, how to correctly get the data to the tv?
I would hate to have to put code in every controller just to load this tv.
There must be a recommended way to do this.
Can some kind soul point me in the right direction?
Thanks ... Ed

Petur Subev
Telerik team
 answered on 21 Jun 2013
1 answer
133 views
Hi,
I've a menu like this (bugged forum, cannot paste the code, I've attached it)

All works fine if I keep commented the second HtmlAttributes (used to set the tooltip through title), if I uncomment that line, the menu show the tooltip but, uses jquery default style (and not kendo theme) and lost item css class 'menuitem'
Aldo
Top achievements
Rank 2
 answered on 21 Jun 2013
3 answers
276 views
Hi Guys,
  I noticed a quirk when testing some code that prevents navigation in before show, as indicated here ... http://docs.kendoui.com/api/mobile/view#events-beforeShow

If I use this technique the tabstrip changes the active tab to the view that was prevented from being displayed, I have a jsfiddle here that demonstrates the issue.  Notice that if you are on view 1, or the view 1 child and you select view 2 (the one that is supposed to be prevented), the navigation is prevented but the tab strip is active on view 2.  I would expect the tabstrip to keep the same tab active as a result of the e.preventDefault call, but perhaps this is deliberate behavior.

  I have a work around for the issue (I just alter the content on view 2 instead of stopping them from navigating to it which is fine for my purposes), so I don't need a fix in a rush I just thought I would bring it to your attention in case you weren't aware.
  -David
Petyo
Telerik team
 answered on 21 Jun 2013
3 answers
345 views
Being new to JavaScript and Kendo I apologise if this is an improper use;

I want to put up a model message; for example if a user deletes something I want to put up an 'Are You Sure' message over the top of the login view. This is a trivial exercise in .Net programming but, as I said, I am new to JavaScript and Kendo. 

Looking through the Mobile Widgets the PopOver seems like a good way of doing of displaying a view over the top of another.
The demonstration shows how to display a PopOver in response to a button click but I cannot find any way of displaying it from a function.
  • Is this possible?
  • Keeping in mind this is a mobile; is there a better way to display?

Thanks for any pointers

Alan

Alan
Top achievements
Rank 2
 answered on 21 Jun 2013
5 answers
874 views
Hi,

I am trying to use grid's column resizing feature, but when I resize the last column in the grid it leaves white space. Please see the attachment to see the issue.

Thank you,

Poonam
Vladimir Iliev
Telerik team
 answered on 21 Jun 2013
1 answer
2.1K+ 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
543 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
160 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
185 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?