Telerik Forums
UI for ASP.NET MVC Forum
0 answers
127 views
I've been trying to figure out why my Grid gets out of date and noticed that even after a Save Changes, the grid doesn't call my Read action. If I click on Cancel Changes after I save the changes then all is well (but it still never calls the Read) so I'm at a loss as to why the results end up showing 'undetermined' if I don't click on Cancel Changes and if there's a way to force the page to do whatever it is that Cancel Changes is doing after a Save.

Any ideas? My grid (which uses editor templates and a client template) is:
@model IEnumerable<Datamart.Models.ViewModels.LEAFundMap>
 
@{
    ViewBag.Title = "CreateFundMap";
    var snapshot = Session["snapshot_id"] ?? Request.Params["snapshot_id"];
}
 
<h2>CreateFundMap</h2>
@(Html.Kendo().Grid(Model)
.Name("Funds")
.Columns(cols =>
    {
        cols.Bound(p => p.entity_fund).ClientTemplate("#=entity_fund#");
        cols.Bound(p => p.fund_desc).ClientTemplate("#=fund_desc.fund_desc#");
    })
.ToolBar(commands =>
    {
        commands.Save();
    })   
.Editable(edit => edit.Enabled(true).Mode(GridEditMode.InCell))
.DataSource(ds => ds
            .Ajax()
            .Model(model =>
                {
                    model.Id(p => p.entity_fund);
                    model.Field(p => p.entity_fund).Editable(false);
                     
                })
            // Configure RU -->
                .Read(read => read.Action("Fund_Read", "Draft").Data("additionalData"))
                .Update(update => update.Action("Fund_Update", "Draft").Data("additionalData"))
                //.ServerOperation(false)
                    .Batch(true)
                .Events(events => events
                    //.Change("onChange") // commented out because it causes an infinite loop
                    .Error("onError")                   
                    )
                )
            // <-- Configure RU
             
            )
 
<script>
function additionalData() {
    return {
        snapshot_id: "@snapshot"
    };
}
 
function onError(e, status) {
    if (e.errors) {
        var message = "The following errors have occurred:\n";
 
        $.each(e.errors, function (key, value) {
            if (value.errors) {
                message += value.errors.join("\n");
            }
        });
 
        alert(message);
    }
}
 
function onChange() {
    var grid = $("#Funds").data("kendoGrid");
 
    grid.dataSource.read();
}
</script>
Samuel
Top achievements
Rank 2
 asked on 18 Nov 2012
3 answers
261 views

Hi. I just want to display a list of values that are retrieved serverside using AJAX.  It calls the AJAX method successfully, but does not display the returned values.

Markup:

      @(Html.Kendo().AutoComplete()
.Name("EditNameAutoComplete")
.DataSource(source =>
            source.Read(read => read.Action("GetUsers", "Administration"))
                .ServerFiltering(true)))

Method:

public JsonResult GetUsers()
{
    string input = Request.Params["filter[filters][0][value]"];
    var adValues = //Get names from Active Directory that start with our input
    var users = adValues.Select(user => user.CommonName).ToList();
    users.Sort();
    return Json(users);
}

Should be simple enough, and it's calling the Ajax method, but not displaying anything afterward. It just acts like a normal textbox. I'm definitely returning strings. What am I doing wrong?
Dave
Top achievements
Rank 1
 answered on 16 Nov 2012
1 answer
119 views
Hi,
I've just updated to 2012.3.1114 and am now receiving the above error in IE in relation to the Menu. How best to fix this?

Stephen Graham
Top achievements
Rank 1
 answered on 16 Nov 2012
0 answers
137 views
Hi everyone,

i'm not sure if its a problem of the AutoComplete, but let me explain my (extremely strange) problem:

We use a kendoMenu --> Clicking on an item opens a modal kendoWindow --> In this kendoWindow is a kendoAutocomplete. As soon as i press enter in this autoComplete the complete page gets refreshed.

This problem only occurs in IE8 and (this is very strange...) as soon as I add a TextBox (hidden or not) in the kendoWindow the problem seems to be solved (no refreshing).

We think that it probably has something to do with the focus or something like that. It also doesn't matter where I place the TextBox the problem is gone. But actually this isnt really the best solution.

Is this a bug? I actually can't really reproduce the problem but probably you know what could cause such phenomenon?
Mathias
Top achievements
Rank 1
 asked on 16 Nov 2012
2 answers
143 views
Folks
I am trying to update our paid verion of KENDOUI.
I run the wizard
Log in with username, which is NOT the same as the user I am using to write this post.
It propmpts me for to download, so I do
It shows download dialog with a header of:

Kendo UI Complete for ASP.NET MVC 2012.3 1114

and a status of "Starting Download"
After 1-2 mins it sows red erro: "The operation has timed out"

How can we fix this issue so I can get the latest software
Greg
Top achievements
Rank 1
 answered on 16 Nov 2012
1 answer
170 views
Is it possible to call a custom popup window or to edit the contents of the built in popup?
AspenSquare
Top achievements
Rank 1
 answered on 15 Nov 2012
0 answers
248 views
Is it possible to add a editable grid in a popup editor of a parent grid? Both grids are Ajax bindings.

Parent Grid View:

@(Html.Kendo().Grid<MyProject.Business.Models.ParentDTO>().Name("ParentGrid")
.Columns(cols => cols.Command(o => o.Edit() ).Title(" "))
.Editable(editor => editor.Mode(GridEditMode.PopUp))
.Events(events=>events.Edit("onEditOfParentGrid"))
.DataSource(datasource => datasource
    .Ajax()
    .Model(model => model.Id(o => o.id))
    .Read(read => read.Action("GetAll", "ParentAjax"))
    .Update(update => update.Action("Update", "ParentAjax"))
    .Create(create => create.Action("Create", "ParentAjax"))
    .Destroy(destroy => destroy.Action("Destroy", "ParentAjax"))
    )
)
<script type="text/javascript">
    function onEditOfParentGrid(e) {
        $('#ChildGrid').data().kendoGrid.dataSource.read({ id: e.model.id })
    }
</script>


Child Grid View (Parent's default EditorTemplate):

@model MyProject.Business.Models.ParentDTO
@(Html.Kendo().Grid<MyProject.Business.Models.ChildDTO>().Name("ChildGrid")
.AutoBind(false)
.Editable(edit=>edit.Mode(GridEditMode.InCell))
.DataSource(datasource => datasource
    .Ajax()
    .Model(model =>model.Id(o => o.id))
    .Read(read => read.Action("GetByParentId", "ChildAjax"))
    .Update(update => update.Action("Update", "ChildAjax"))
    .Create(create => create.Action("Create", "ChildAjax"))
    .Destroy(destroy => destroy.Action("Destroy", "ChildAjax"))))

Doing this will screw up the popup editor by showing it inline and write some javascript (as text). The child grid will also loose the data. If the child grid has no editor (aka read only), everything works fine, data is shown.


Theres a jQuery error in the console but it doesn't (at least for me) says much

    Uncaught SyntaxError: Unexpected token ILLEGAL jquery-1.8.2.js:564
      (anonymous function) jquery-1.8.2.js:564
      jQuery.extend.globalEval jquery-1.8.2.js:565
      (anonymous function) jquery-1.8.2.js:6006
      jQuery.extend.each jquery-1.8.2.js:611
      jQuery.fn.extend.domManip jquery-1.8.2.js:5991
      jQuery.fn.extend.append jquery-1.8.2.js:5764
      jQuery.fn.(anonymous function) jquery-1.8.2.js:6186
      h.extend._createPopupEditor kendo.all.min.js:8
      h.extend.editRow kendo.all.min.js:8
      (anonymous function) kendo.all.min.js:8
      jQuery.event.dispatch jquery-1.8.2.js:3063
      elemData.handle.eventHandle jquery-1.8.2.js:2681
Pier-Luc
Top achievements
Rank 1
 asked on 15 Nov 2012
0 answers
162 views

In my grid I placed a custom command "Copy" which  copies a value of a column to two other values in other columns in the Click-handler CopyClick. Now I would like to enter the edit mode for the row. How can I do that? I tried grid.editRow(row) but it did not worked. Probably I passed the wrong parameter to it. What must row be as a parameter to editRow()?

 

@(Html.Kendo().Grid<MyViewModel>()
    .Name("MyGrid")
    .Columns(columns =>
    {
      columns.Command(command =>
      {
            command.Edit();
            command.Destroy();
            command.Custom("Copy").Click("CopyClick");
      });
   
 
    â€¦â€¦
 
    function CopyClick(e)
    {
        e.preventDefault();
        var grid = $("#UnterhaltGrid").data("kendoGrid");
        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
 
        dataItem.Val1 = dataItem.Val0;
        dataItem.Val2 = dataItem.Val0;
 
        grid.refresh();
    }

 

 

 

 

 

Linus
Top achievements
Rank 1
 asked on 15 Nov 2012
1 answer
646 views

I want to bind to a controller called articles but am getting an exception as follows
0x800a138f - JavaScript runtime error: Unable to get property 'DataSource' of undefined or null reference


<!DOCTYPE html >

<HTML>
<head>
    <title>content</title>
    <link href="~/Content/kendo/2012.2.710/kendo.common.min.css" rel="stylesheet" />
    <link href="~/Content/kendo/2012.2.710/kendo.default.min.css" rel="stylesheet" />

</head>
    <body>
        <div id="articlesgrid"> </div>

        <script src="~/Scripts/jquery-1.7.2.js"></script>
        <script src="~/Scripts/kendo/2012.2.710/kendo.web.min.js"></script>
        <script>
            $(function()
            {
                $("#articlesgrid").kendoGrid(
                    {
                        dataSource: new kendo.Data.DataSource({
                            transport: {
                            read : "Api/Articles"
                        }}
                        )
                    })
                }
            );

        </script>
    </body>
</HTML>

 

#''''''''''''''''''''''''''''''''''''''''''''''''''''''''

 public class ArticlesController : Controller
    {
       public List<Article> Get()
        {
            List<Article> lst = new List<Article>();
            lst.Add(new Article() { ID = 1, Name = "AAA", Price1 = 1.22m });
            lst.Add(new Article() { ID = 1, Name = "BBB", Price1 = 1.32m });
            lst.Add(new Article() { ID = 1, Name = "CCC", Price1 = 1.42m });

            return lst;
        }
    }
}

 

 

Vladimir Iliev
Telerik team
 answered on 15 Nov 2012
2 answers
120 views
Hi,

there is no problem when using KendoUI only with HTML and jQuery. I have the control where on the page my scripts and functions are executed.

When using the HTML-Helper in Razor all function are written in the middle of the DOM and I get the famous "jquery is not defined" exception.

InlineScripts or InlineStyles are a bad style for webperformance.
So I ask if there is a way to use HTML-Helper without writing all scriptlibraries in the head? 
Atanas Korchev
Telerik team
 answered on 15 Nov 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Security
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
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?