Telerik Forums
UI for ASP.NET MVC Forum
3 answers
175 views
I have a very complex Model which has multiple objects some of them are lists.
for example :
Data.MylistObject[0].StatusID

when I pass

var name =  ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty);

@Html.Kendo().ComboBox().Name(name)

on the page html the 

jquery that creates the combo will look like :

jQuery(function(){jQuery("#Data.MylistObject[\\0\\]_StatusID.kendoComboBox

but jscript code refrencing the combo written in @ 
$('[name=@id].data('kendoComboBox')

is translatet to this code on the page

$('[name=Data.MylistObject_0__StatusID].data('kendoComboBox')

this inconsistency causes the code that is ment to taggle the options.filter paramenter to stop working due to the fact that the combo is not selected due to the difference in names.

the only way I found arround this is to pass  the id to the name property @Html.Kendo().ComboBox().Name(id)

and use 

$('#@id].data('kendoComboBox')

which works , there seems to be a problem with the way kendo parse [0] part of the member name.

Yours,

Ariel




Daniel
Telerik team
 answered on 24 Jul 2013
1 answer
75 views

Hello,

I am creating a menu and I am trying to get the LAST item to float right,
as you can see in my code, I am setting the last item HTMLAttributes @class to float right but it is not repsecting that.

What can I do to fix it.

@(Html.Kendo().Menu().Name("Menu")
            .Items(items =>
                {
                    items.Add().Text("Clear Jobs")
                        .Items(i =>
                            {
                                int days = ViewBag.LogDetailDays;
 
                                i.Add().Text("Clear jobs created more than " + days + " days ago")
                                    .Action("Jobs_DeleteLast", "Jobs")
                                    .HtmlAttributes(new { onclick = "return confirm('Are you sure you want to clear jobs?');" });
                                i.Add().Text("Clear all jobs")
                                    .Action("Jobs_DeleteAll", "Jobs")
                                    .HtmlAttributes(new { onclick = "return confirm('Are you sure you want to clear jobs?');" });
                            });
 
                    items.Add().ImageUrl("~/Images/refresh.png")
                         .Url("~/Jobs.html")
                         .HtmlAttributes(new { onclick = "refreshGrid()",
                                               @class = "float-right",
                                               title = AdminUI.RefreshButton_Tooltip })
                                               .Url("#");
                })
    )
Dimo
Telerik team
 answered on 24 Jul 2013
1 answer
112 views
How do I add a button to a tooltip so that when it is clicked it passes the dataItem of that point to a function? I need this to work across multiple types of charts.
Hristo Germanov
Telerik team
 answered on 23 Jul 2013
1 answer
110 views
Hi,
 
im building a hierachy using grids for example: category -> products -> orders. i have in my category a list of products (public list<products> products {get; set;} and my products have a list of orders (public list<orders> orders { get; set; }).im using a hierachical grid structure with client templates defined for the parent grids.

Now, when i add a category i do not create a record in DB but create it only on the Client (through javascript/Jquery) and so with products and orders. (i have logic to uniquely identify elements(grids) in the hierachy that enables me to add children under parent nodes). I want to be able to save all changes at one shot when i click a button(Save).

* has someone tried something like this before with hierachical grid?
* Is there an another way to accomplish this?
* I tried to loop through the grid in javascript and take the data from child grids and assign it to the parent. i.e take orders and put it under products then take these products and put them under category. Once i call grid.saveChanges() (on the top most parent grid) and reach the controller the product list in category has fields that are null or if there are integer properties they are all reset to 0. Serialize? type mis match? what is causing this behavior? any examples?

basically, if i could build an association with parent and child grid without hitting the controller to fetch child information with the #=parentID# that would be great!

thanks!
Petur Subev
Telerik team
 answered on 23 Jul 2013
2 answers
423 views
I m trying to add resources from the server. Is this possible.
I tried passing a Ienumerable from the viewmodel to bindto, but got error above.
I tried using read on resouces , I do not get an error but colors not showing up
Any example on how to do this? I think I am lost here

What I have so far.
@code
    Dim s As Kendo.Mvc.UI.Scheduler(Of BO.Models.Bookings.BookingEvent) = Html.Kendo().Scheduler(Of BO.Models.Bookings.BookingEvent)() _
    .Name("scheduler") _
    .Date(Date.Today) _
    .StartTime(Date.Today.AddHours(7)) _
    .Height(600) _
    .Timezone("America/Phoenix").Resources(Function(resource) resource.Add(Function(m) m.TeamId) _
                                           .Title("Owner") _
                                           .DataTextField("Name") _
                                           .DataValueField("TeamId") _
                                            .DataColorField("Color") _
                                           .DataSource(Function(d) d.Read("resouces", "services", New With {.area = String.Empty}))) _
    .Views(Sub(views)
                   views.DayView()
                   views.WeekView(Function(weekView) weekView.Selected(True))
                   views.MonthView()
                   views.AgendaView()
           End Sub) _
    .DataSource(Function(d) d.Model(Sub(m)
                                            m.Id(Function(f) f.BookingId)
                                            m.Field(Function(f) f.TeamId).DefaultValue(1)
                                    End Sub) _
    .Read("read", "services") _
    .Create("Create", "Scheduler") _
    .Destroy("Destroy", "Scheduler") _
    .Update("Update", "Scheduler"))
 
    s.Render()
End Code
Alan Mosley
Top achievements
Rank 1
 answered on 23 Jul 2013
6 answers
128 views
Hello there,

At the moment, I'm trying to create a grid where user is able to choose a product category in a first step, and then choose a product which belongs to the selected product category. All the cascading stuff is working perfectly using ForeignKey and custom editor.

However, Foreignkey columns are binded to ID in model. So, when a selection is done, the displayed value is always the ID. I would like to display the value which match to the selected ID instead. I tried doing it through ClientTemplate, but it didn't work. I didn't find some custom property about it too.

If require, I can post some code & screenshots.

Thanks for answers :)
Claude
Top achievements
Rank 1
 answered on 22 Jul 2013
2 answers
519 views
I've read various threads about how to get an actionlink in a column in an AJAX grid and have successfully implemented that portion of it.  However, in the case of this link I need it to use HttpPost to the server.  The purpose of the link is to allow download of a document.  However, we don't want parameters visible in the querystring that identify the particular document as it is in the database.  So I have the Action which is called with the document id via POST retrieve the document, store it in session and return a GUID linked to that session variable along with the URL to the retrieval page.  I then submit a dynamically created form which goes to that retrieval page, passing it the GUID, and gets the document for download.

To that end I created a function to attach to a classed link and use JQuery to post it to the server.  It works perfectly for an ActionLink outside the AJAX bound grid but inside the grid it doesn't call that javascript function, instead it attempts to call the Action via Get which is disallowed so I get a 404 error.  Is there some other way to tell the ActionLink in the grid to use the javascript function? I would appreciate any help you could provide.

I've attached a text file with the javascript function and the ActionLink and Grid declarations.

Daniel
Telerik team
 answered on 19 Jul 2013
1 answer
229 views
Hello, 

I have Kendo MVC grid with In-line editing. When I click on save button is show following error message and unable to update record.

I'm using  "Kendo UI Complete v2013.1.514 (http://kendoui.com)" version.

-------------------------------------------------
kendo.web.min.js (line 9, col 1)

SyntaxError: missing ; before statement

d.0=value
-------------------------------------------------
 

Do anyone is having any solution regarding this.

Thanks,
-Nandu.
Dimiter Madjarov
Telerik team
 answered on 19 Jul 2013
7 answers
174 views
Hello!
I use Tabstrip(asp mvc)! I have two tabs;
Example:
I select second tab;
I have grid in first tab
And If I use this:
grid.showColumn() 
All good, but if I use grid.hideColumn
I see this:
screan_1.png
But I need:
screan2.png
Gusev
Top achievements
Rank 1
 answered on 19 Jul 2013
1 answer
128 views
Hi,

I have a grid configured on ASP MVC using Razor with a custom editor template, to show a textarea for editing a big text field.

The grid as per client requirements, needs to allow incell edit and keyboard navigation.

The problem I'm having is that having that configuration doesn't allow me to press Enter key for adding new lines on the textarea while editing, instead cause the cell get out of edit mode.

Couldn't find a way to suppress that behavior nor to change it.

Any ideas?
Vladimir Iliev
Telerik team
 answered on 19 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?