Telerik Forums
Kendo UI for jQuery Forum
4 answers
371 views
Hello,

I have a grid which is using a popup editor form, so I have a shared view serving as the popup form. Inside that shared view I am editing a string field by using:

@Html.EditorFor( zone=> zone.ZoneContents, "ContentEditor", new { contents = Model.ZoneContents})

So this is using my "ContentEditor" shared view which is under the Views/Shared/EditorTemplates folder. All is well and good. The editor appears, I'm able to insert content and then when I try to update I get an error because zone.zonecontents is null.

Why would it not be updating the model with the value?

I would have posted some more code in here but the formatter isn't currently working and it would be pretty ugly. I can post more later, just let me know what you want to see.

Thanks!

Cool Breeze
Top achievements
Rank 1
 answered on 25 Mar 2014
3 answers
212 views
I have a grid that when it tries to update, the ID field of my model is an empty guid when it gets back to the controller. I am displaying the column in the guid and the value is definitely there. What would cause the ID to be stripped out like that?

Here is my view with the grid:

@model List<Common.Models.Brand>
 
@{
    ViewBag.Title = "Maintain Brands";
}
 
<h2>Maintain Brands</h2>
 
@(Html.Kendo().Grid(Model)
    .Name("MaintainBrandsGrid")
    .Columns(columns =>
    {
        columns.Bound(brand => brand.BrandId).Title("Id");
        columns.Bound(brand => brand.BrandName).Title("Brand Name");
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(185);
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    .Scrollable(scr=>scr.Height(430))
    .Filterable()   
    .DataSource(dataSource => dataSource       
        .Ajax()
        .PageSize(20)
        .ServerOperation(false)
        .Model( model => model.Id( brand => brand.BrandId))
        .Create( create => create.Action("AddBrand", "BrandMaintenance"))
        .Update( update => update.Action("UpdateBrand", "BrandMaintenance"))
        .Destroy( delete => delete.Action("RemoveBrand", "BrandMaintenance"))
        )       
     )

And here is the UpdateBrand method from the BrandMaintenance controller:

//
        // POST: /BrandMaintenance/UpdateBrand
        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult UpdateBrand([DataSourceRequest]
                                        DataSourceRequest request, Brand brand)
        {
            if (brand != null && ModelState.IsValid)
            {
                var bll = new CatalogMaintenanceBll();
                bll.UpdateBrand(brand);
            }
 
            return Json(new[] { brand }.ToDataSourceResult(request, ModelState));
        }

I have several other grids that were created the exact same way and they are all working, so I am wondering what I could possibly be missing that could cause this.

Thanks for any help!








Cool Breeze
Top achievements
Rank 1
 answered on 25 Mar 2014
2 answers
187 views
Hello everybody,

i'm trying to make one grid with Hierarchy, but the hierarchy grid return all rows everytime.

To populate the grids, i have two json files:
-OS.json to principal;
-ITEM.json to hierarchy grid;

OS.json:
[{"cdOS":474103,"cdSelb":"X112","solicitante":"CLEBSON "},
{"cdOS":474104,"cdSelb":"A335","solicitante":"FERNANDO "}]

ITEM.json:
[{"cdOS":474103,"status":"ABERTO","usuario":"nivaldo.oliveira"},
{"cdOS":474103,"status":"FECHADO","usuario":"carlos.alberto"},
{"cdOS":474104,"status":"ABERTO","usuario":"nivaldo.oliveira"},
{"cdOS":474104,"status":"FECHADO","usuario":"carlos.alberto"}]



<div id="grid"> </div>

                $(document).ready(function() {
                    var element = $("#grid").kendoGrid({
                        dataSource: {
                            type: "json",
                            pageSize: 10,
                            serverPaging: true,
                            serverFiltering: true,
                            serverSorting: true,
                            transport: {
                                read: {
                                    url: "js/OS.json",
                                    dataType: "json"
                                },
                                schema: {
                                    model: {
                                        fields: {
                                            cdOS: { type: "number" },
                                            cdSelb: { type: "string" },
                                            solicitante: { type: "string" }
                                        }
                                    }
                                }
                            }
                        },
                        height: 550,
                        filterable: true,
                        sortable: true,
                        pageable: true,
                        detailInit: detailInit,
                        dataBound: function() {
                            this.expandRow(this.tbody.find("tr.k-master-row").first());
                        },
                        columns: [{
                            field: "cdOS",
                            title: "OS"
                        },
                        {
                            field: "cdSelb",
                            title: "SELB"
                        },
                        {
                            field: "solicitante",
                            title: "Solicitante"
                        }]
                        });
                    });

                function detailInit(e) {
                    $("<div/>").kendoGrid({
                        dataSource: {
                            type: "json",
                            transport: {
                            read: {
                                url: "js/ITEM.json",
                                dataType: "json"
                                },
                                schema: {
                                    model: {
                                        fields: {
                                            cdOS: { type: "number" },
                                            status: { type: "string" },
                                            usuario: { type: "string" }
                                        }
                                    }
                                }                                
                            },
                            serverPaging: true,
                            serverSorting: true,
                            serverFiltering: true,
                            pageSize: 6,
                            filter: { field: "cdOS", operator: "eq", value: e.data.cdOS }
                        },
                        scrollable: true,
                        sortable: true,
                        pageable: true,
                        columns: ["cdOS", "status","usuario"]
                    }).appendTo(e.detailCell);
                }


Anybody can help-me to resolve this issue?
I wanna to return only two rows in hierarchy grid, for one row in principal grid, the link is "CdOS".

Thanks!
Umesh
Top achievements
Rank 1
 answered on 25 Mar 2014
2 answers
104 views
Ok... frustratingly this is the second time I'm writing this as the first post failed for some reason.

I know there is a similar post to this here, http://www.telerik.com/forums/stacked-column-chart-where-group-is-a-property but the example code looks nothing like the api documentation, so hopefully someone can explain what's wrong with mine.  The grouping is missing the first day completely!

Json looks like:
[{"tdate": "2014-03-18T00:00:00", "data": 652.48 , "CatName": "Starters"},{"tdate": "2014-03-18T00:00:00", "data": 1245.87 , "CatName": "Spirits"},{"tdate": "2014-03-21T00:00:00", "data": 326.55 , "CatName": "Beers"},{"tdate": "2014-03-22T00:00:00", "data": 124.28 , "CatName": "Beers"},{"tdate": "2014-03-24T00:00:00", "data": 785.24 , "CatName": "Starters"},{"tdate": "2014-03-24T00:00:00", "data": 444.74 , "CatName": "Beers"},{"tdate": "2014-03-24T00:00:00", "data": 345.54 , "CatName": "Spirits"}]

HTML
<div id="chart"></div>

Script:
var myTheme = 'metro';

var myds = $('#MainContent_hdn1').val();
var jsondata = $.parseJSON(myds);

var mydatasource = new kendo.data.DataSource({
group: [
{ field: "CatName" }
],
sort: { field: "tdate", dir: "asc" },
data: jsondata
});

$("#chart").kendoChart({
dataSource: mydatasource,
series: [{
field: "data"
}],
group: { field: "CatName" },
categoryAxis: {
field: "tdate",
baseUnit: 'day',
type: 'date',
majorGridLines: {
visible: false
},
line: {
visible: false
}
},
seriesDefaults: {
stack: true
},
chartArea: {
height: 250
},
theme: myTheme,
tooltip: {
visible: true,
template: "#= series.name #: #= value #"
}
});

Output looks like attached pic.
Iliana Dyankova
Telerik team
 answered on 25 Mar 2014
2 answers
599 views
I'm trying to hook up the new locked column functionality, and having some odd display behavior with my footers.  It looks like the footer of non-locked columns are wrapping around underneath the locked footers instead of showing under the appropriate columns.  I was able to reproduce this with the demo page by adding footer templates to the columns there (which can be seen below).  Is this a bug or something that is not supported?  In my case, I have some columns where I want to show the sum of the data in the footer if possible.  Thanks for your help!

Regards,
Brian

<!DOCTYPE html>
<html>
<head>
    <title>Frozen columns</title>
    <meta charset="utf-8">
    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.default.min.css" rel="stylesheet">
 
    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.web.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
    <script>
         
    </script>
     
     
</head>
<body>
     
        <a class="offline-button" href="../index.html">Back</a>
     
    <div id="example" class="k-content">
    <div id="grid"></div>
 
    <script>
        $(document).ready(function() {
            $("#grid").kendoGrid({
                dataSource: {
                    type: "odata",
                    transport: {
                        read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
                    },
                    schema: {
                        model: {
                            fields: {
                                OrderID: { type: "number" },
                                ShipCountry: { type: "string" },
                                ShipName: { type: "string" },
                                ShipCity: { type: "string" },
                                ShipAddress: { type: "string" }
                            }
                        }
                    },
                    pageSize: 30
                },
                height: 430,
                sortable: true,
                reorderable: true,
                groupable: true,
                resizable: true,
                filterable: true,
                columnMenu: true,
                pageable: true,
                columns: [ {
                        field: "OrderID",
                        title: "Order ID",
                        locked: true,
                        lockable: false,
                        width: 120,
                        footerTemplate: "Order ID"
                    }, {
                        field: "ShipCountry",
                        title: "Ship Country",
                        width: 200,
                        footerTemplate: "Ship Country"
                    }, {
                        field: "ShipCity",
                        title: "Ship City",
                        width: 160,
                        footerTemplate: "Ship City"
                    },{
                        field: "ShipName",
                        title: "Ship Name",
                        locked: true,
                        width: 200,
                        footerTemplate: "Ship Name"
                    },  {
                        field: "ShipAddress",
                        lockable: false,
                        width: 300,
                        footerTemplate: "Ship Address"
                    }
                ]
            });
        });
        </script>
</div>
 
     
             
</body>
</html>

Brian Roth
Top achievements
Rank 1
 answered on 25 Mar 2014
2 answers
156 views
I am finding it impossible to use the Chrome Developers debugger today. The issue is constant DOM errors of the form:

event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

Coming from jquery-1.9.1 

This is fixed in newer versions of jquery,

But I am using Kendo UI Complete v2013.3.1324 and that comes with 1.9.1

Suggestions?

using Chrome 33.0.1750.154 m


Dr.YSG
Top achievements
Rank 2
 answered on 25 Mar 2014
7 answers
141 views
I have some footer tabs that are typically a green/brown color depending on their selection status. They have an icon as well as some text below them.

On the windows simulator, however, the icons are white and only the text changes color correctly. Also, every now and then the icons all turn black instead of white.
Michael
Top achievements
Rank 1
 answered on 25 Mar 2014
1 answer
131 views
I'm using data binding with MVVM for my grid and am trying to apply a custom filter but it doesn't seem to be picking it up am I doing something wrong?

data-filterable="extra: false, operators: { string: { startswith: 'starts with', eq: 'Is equal to' , neq: 'Is not equal to' } }"
Alexander Valchev
Telerik team
 answered on 25 Mar 2014
3 answers
159 views
Do the Kendo UI Data Viz javascript APIs for the chart, sparklines, etc support updates to the underlying data source? For example, I'm going to have a JavaScript data source for a scatter plot and when the data source array is updated, I'd like the charts to reload the data and animate the points into the new position. Is this something Kendo supports?
Iliana Dyankova
Telerik team
 answered on 25 Mar 2014
1 answer
412 views
I have a kendo editor control which is used to edit text containing <br> tags for newlines.  The text is long, causing the editor to show a scroll bar.  To preserve compatibility with existing data, I have overridden the newline command to insert <br> tags instead of paragraphs:

      $("#txtEditor").kendoEditor({
        tools: [
          { name: "insertLineBreak", shift: false },
        ]
      });

This works fine, except that when I do this and insert a new line near the top, now the editor scrolls to the end of the text block, which makes the scroll bar jump down.  Is there any way to avoid this happening?

I am using Kendo UI Complete v2013.3.1119 and the JQuery version it came with, Windows 7, tested in Firefox 27.  I can replicate this in the demo on the Kendo site as well by inserting some text and using shift+enter to insert some new lines.
Dimo
Telerik team
 answered on 25 Mar 2014
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
Drag and Drop
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
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?