Telerik Forums
Kendo UI for jQuery Forum
0 answers
156 views
I've a grid with a custom template modal window for edit & add. The template has drop down list field defined like below:

<div class="k-edit-label">
            <label for="ColName">Site</label>
</div>
<input name="ColName" data-source="ColNameDataSource" data-text-field="colName" 
      data-value-field="dartSiteName" data-bind="value:ColName" data-role="dropdownlist" />

When I edit a row and change the value of the drop-down it shows correctly in the grid.

But if I Add a row and change the value of the drop down it shows up as [object Object]. Does anyone have any idea what could I be doing wrong?
Thanks.
Just
Top achievements
Rank 1
 asked on 28 Sep 2012
0 answers
89 views
I have a hierarchical grid with 3 levels, in which the 2nd and 3rd levels are bound on the client side during expansion of the row through the OnDataBinding ClientEvent.

Sample code for binding I am doing:

    function detailGrid_dataBinding(e) {
        if ($(this) != undefined) {
            var grid = $(this).data("tGrid"),
                masterRow = $(this).closest("tr.t-detail-row").prev(),
                dataItem = $("#Status").data("tGrid").dataItem(masterRow);

            grid.dataBind(dataItem.Details);

            e.preventDefault();
        }
    }

However, when I apply the sorting/filtering/paging options to grid in the detail view, the visualization for the feature shows up but they don't function.

Is this a known issue?
John
Top achievements
Rank 1
 asked on 28 Sep 2012
0 answers
146 views
I've defined a Grid on an aspx page in a MVC 3 project. The "Parent" (Customers) grid has inline editing which works fine. I defined a subgrid of the parent using the ClientDetailTemplateId.

That sub grid displays values just fine. I've also enabled Editing in the subgrid such as

.DataSource(ds => ds
.Ajax()
.Read(read => read.Action("GetCustomerAddresses", "Address", new { Customer = "#CustomerID#" }))
.Update(update => update.Action("UpdateAddress", "Address"))
.Create(update => update.Action("NewAddress", "Address"))
.Destroy(update => update.Action("DeleteAddress", "Address"))
.Model(model => model.Id(a => a.AddressID))
)

In the subgrid when I select the "Edit" button the row goes into editing mode fine, When I click the "Update" button, an error is thrown saying
http:.//localhost/Address/Create is not found  404 not found.

Why the Controller method "Create" is being called is completely beyond me.

Edit your post Reply

Jeff
Top achievements
Rank 1
Veteran
 asked on 28 Sep 2012
4 answers
195 views
I have a Grid connected to DataSource and displayed on clipboard01.jpg
When I click on the Calculate button, I collect some the Grid's data and send it over to the server with an Ajax call
I return Json with some calculated values for the MTM field, which I'm adding to the grid...

    $.ajax({
        type: "POST",
        dataType: "json",
        data: unwindDataToPostObj,
        url: direction
    })
    .done(function (response) {
        var grid = $("#gridAssoc").data("kendoGrid");
        grid.dataSource.data(response);
        grid.refresh();
    })
    .fail(function (jqXHR) {
        console.log("error");
    });

Please look at picture: clipboard02.jpg now
The formatting for the Trade Date & Settle Date is now broken, although it was declarative set by the book.

    // ** Grid widget
    $("#gridAssoc").kendoGrid({
        dataSource: CFDUnwind._assocTradesDataSource,
        navigatable: true,
        selectable: "single",
        height: 300,
        resizable: true,
        sortable: {
            mode: "single",
            allowUnsort: false
        },
        columns: [
            { field: "Strategy", title: "Strategy", width: 60 },
            { field: "ImagineSNum", title: "ImagineSNum", width: 50 },
 
            {
                field: "TradeDate", title: "Trade Date", width: 48,
                template: '#= kendo.toString(TradeDate,"MM/dd/yyyy") #'
            },
            {
                field: "SetlDate", title: "Settle Date", width: 48,
                template: '#= kendo.toString(SetlDate,"MM/dd/yyyy") #'
            },
...etc....

1. Why is the formatting not obeyed?
2. In other words how do I manually set the data on the grid and preserve any formatting already set on the columns?

~ Boris
Boris
Top achievements
Rank 1
 answered on 28 Sep 2012
0 answers
107 views
This is probably simple, but I've not found a solution. I've a ground declared like so:

    <div id="grid" 
         data-role="grid" 
         data-bind="source: tasks" 
         data-columns='[{ "field": "taskId", "width": "150px", "title": "Id" }, ... ]' 
         data-pageable='{ "pageSize": 10 }'
         data-groupable='[{ "field" : "completionStatusDescription", "aggregates": [{"field": "taskId", "aggregate": "count"}] }]'
        >
    </div>

This is bound to a view model and all works fine except for the grouping. Is the above the correct format? I couldn't find explicit docs on this and just guessed, which is probably why it isn't working. The grouping works in the UI, although I can't configure the aggregates.

Is this possible, or have I just got the synax wrong?

Thanks

d
Dave
Top achievements
Rank 1
 asked on 28 Sep 2012
4 answers
920 views
I'm having some issues getting the kendo grid for mvc to work properly (especially the add button in the toolbar). I have a grid with editing in a popup window. For this I'm using a custom template which is in Views/Location/EditorShow.

The edit command is working just fine since this is showing up a popup for the user to edit data in (basically this loads Views/Location/EditorShow like I want it to). The delete command is also working just fine too.

The problem however is the Add command which is situated inside the toolbar. This one does not seem to have a correct url (it's pointing to the root of the website). Also find attached a screenshot showing to source of the add button. If I surf to ?GridLocations-mode=insert manually however a create popup is showing up.

Quite a strange situation, because there seems to be only a problem with the url of the add button in the toolbar.
Any ideas on what may be causing this??

P.S. Below is the code I'm using in my .cshtml file:

@Html.Kendo().Grid(Model).Name("GridLocations").Columns(columns =>
    {
        columns.Bound(l => l.Name).Title("Name");
        columns.Command(command =>
       {      
          command.Edit().Text("Edit");
          command.Destroy().Text("Delete");               
       }).HeaderTemplate("Manage");
         
}).ToolBar(toolbar => toolbar.Create().Text("Create")).DataSource(dataSource => dataSource
        .Server() 
        .Model(model => model.Id(l => l.Id))         
        // Configure CRUD -->       
        .Create(create => create.Action("Create", "Locations"))
            .Read(read => read.Action("Index", "Locations"))
            .Update(update => update.Action("Update", "Locations"))
            .Destroy(destroy => destroy.Action("Delete", "Locations"))       
        // <-- Configure CRUD   
        ).Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("EditLocations"))

I don't think this does contain any strange stuff, since it's mostly the same as the examples on the website.
Any thoughts on why the add button is not working properly like expected?
Willem
Top achievements
Rank 1
 answered on 28 Sep 2012
2 answers
351 views
Hey guys,

I'm using DataSource to drive a sort of "live filtering". After a filter's been applied I reload the data-source with the appropriate get-vars, but I want to add the results-count to this. I'm pretty flexible in how I construct my json (example of current json below), but I'm not sure how I would use kendo to place this somewhere in my html. My json looks like this:

{
 "results": [
{
 "title": "My entry",
 "description: "My description"
},
{
 "title": "Another entry",
 "description: "Another description"
},
]
}

So my questions are:

- Where in my json would I add the result-count?
- How do I make kendo render this to the current document?

Thanks guys!

- Steven
Steven
Top achievements
Rank 1
 answered on 28 Sep 2012
1 answer
212 views
How do you prevent the menu from closing on the mouseout event? I want the menu only close if you click somewhere else outside of the menu.
Kamen Bundev
Telerik team
 answered on 28 Sep 2012
0 answers
68 views
I want to use ' in the text field of the category in this demo: http://demos.kendoui.com/web/grid/foreignkeycolumn.html

But, when I use this character it breaks and will not show any grid at all. Escaping it with \ or using the ascii code did not work at all for me.

Does anyone have some insight on this?

Cheers
Bart
Top achievements
Rank 1
 asked on 28 Sep 2012
1 answer
592 views
Whenever I hit the "create" action on a Kendo Grid, it runs the same server side call for every item in the list that I created.

For example, I have three columns Increment/Range/SetId.

I add one item: 1/1/1
This calls my CreateItem method for the 1/1/1 item.

I add a second item: 2/2/1
This calls my Create Item method for the 1/1/1 item and the 2/2/1 item.

I now have items saved in my database as follows:
1/1/1
1/1/1 (Duplicate)
2/2/1

This pattern continues for as many items as I create. My Kendo code is as follows:

@(Html.Kendo().Grid<Model.IncrementSetItem>()    
            .Name("IncrementSetItemGrid")    
            .Columns(columns => {        
                columns.Bound(p => p.IncrementSetID);
                columns.Bound(p => p.Increment).Width(140);
                columns.Bound(p => p.RangeHigh).Width(140);
                columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
            })
            .ToolBar(toolbar => toolbar.Create())
            .Editable(editable => editable.Mode(GridEditMode.InLine))
            .Pageable()
            .Sortable()
            .Scrollable()
            .DataSource(dataSource => dataSource        
                .Ajax()                 
                .Events(events => events.Error("error_handler"))
                .Model(model => model.Id(p => p.ID))
                .Create(create => create.Action("CreateItem", "IncrementSet"))
                .Read(read => read.Action("GetIncrementSetItemsList", "IncrementSet"))
                .Update(update => update.Action("UpdateItem", "IncrementSet"))
                .Destroy(destroy => destroy.Action("EditingInline_Destroy", "Grid"))
            )
        )

Please let me know if there is a way to have the "Create" event only act on just the last item that I have created inline.
Alexander Valchev
Telerik team
 answered on 28 Sep 2012
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
Drag and Drop
Application
Map
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
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
Styling
ColorPicker
Pager
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
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
LLM Kit
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?