Telerik Forums
Kendo UI for jQuery Forum
7 answers
466 views
I have this grid on one of my pages
<div id="SearchResults">
        @Html.Kendo().Grid(Model).Name("grdSearchResults").Columns(column=>
        {
            column.Bound(c => c.FormID).Title("Form Number");
            column.Bound(c => c.Country).Title("Country");
            column.Bound(c => c.State).Title("State");
            column.Template(c => @Html.ActionLink(c.Description, "FileBoundGetForm", new { id = c.FormID }, new { @target = "_blank" })).Title("Description");
            column.Bound(c => c.ModifiedUser).Title("Modified User");
            column.Bound(c => c.CreatedDate).Title("Created Date");
        }).DataSource(ds =>
                     ds.Ajax()
                    .Read(reader => reader.Action("DSReleaseForms", "ReleaseForm", new { ByCountry = ViewBag.stateFilter, ByState = ViewBag.countryFilter }).Data("additionalData"))).Pageable()
</div>

My template column renders exactly as it should all good. However i have this on another page
<div id="results">
            @Html.Kendo().Grid(Model).Name("grdClientResults").Columns(column =>
            {
                column.Template(@<text>
                    @Html.ActionLink(@item.ClientID.ToString(), "ClientAdmin", new { id = @item.ClientID })</text>).Title("Edit");//.ClientTemplate("<a href='/ClientAdmin/ClientAdmin/GetClient/#=ClientID#'>#=ClientID#</a>");
                column.Bound(c => c.ClientID).Title("Client Id");
                column.Bound(c => c.Name).Title("Client Name");
                column.Bound(c => c.Address1).Title("Address");
                column.Bound(c => c.Address2).Title("Address2");
                column.Bound(c => c.City).Title("City");
                column.Bound(c => c.StateProvince).Title("State");
                 
            }).DataSource(ds =>
               ds.Ajax()
                        .Read(reader => reader.Action("ClientDetail", "ClientAdmin"))).Pageable()
        </div>
My column template renders 'undefined' as soon as put the template on the column I get this error. has any one else have the problem? I've tried using the clientTemplate as well but the link never postbacks the value and my ID is always null. Can some one point me in the right direction? Thank you in advanced
Nikolay Rusev
Telerik team
 answered on 11 Sep 2014
1 answer
672 views
Hi,

I got this window that the second time is called a JavaScript error shows “TypeError: Cannot read property ‘refresh’ is undefined’
 
Please help.

~~~~~~~~~~~~~~~~~~~~ Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@(Html.Kendo().Window().Name("window").Visible(false).Modal(true).Width(1000).Height(700))


<a onclick="verReporte()" class="btn btn-primary">Ver Reporte</a>


function verReporte() {        var precinto = $("#ddlPrecinto").val();
        var unidad = $("#ddlUnidad").val();
        if (unidad == "<Todos>") {           
            unidad = '';        };
       var status = $("#ddlStatus").val(); 
       var category = $("#ddlCategory").val();
       var data = { reportname: "VoterList.trdx", parameters: "Precinto=" + precinto + ",Unidad=" + unidad + ",Status=" + status + ",Category=" + category };
       var myurl = '@Url.Action("ReportViewerGeneric","Report")';        

       var mywindow = $("#window").data("kendoWindow");
       mywindow.refresh({           
                 url: myurl,   
                 data: data       
         });        
        mywindow.title("");       
        mywindow.center();       
        mywindow.open();      
};
Dimo
Telerik team
 answered on 11 Sep 2014
7 answers
183 views
Hi, I want to know how to call the template function for certain column value. I mean the function that the grid applies to a dataSource value to get the value that shows on the grid. I´m not defining any template function for that column, what i need to know is what function the grid applies to every value on a column that doesn´t have a custom template function.
Example:
-In the dataSource i have a date value: Date {Mon Aug 11 2014 00:00:00 GMT+0200}
-In the grid, after the template function i´m looking for is applied to this value, you can see: 11/08/2014.

I´ve looked for it, but couldn´t find it.
Thanks a lot.
Alexander Popov
Telerik team
 answered on 11 Sep 2014
6 answers
185 views
When there are multiple handlers for a drop location, after handling the one I want, how do I prevent anymore handlers from firing ?

See http://jsfiddle.net/RichardAD/qYQ7m/

Do I use a kendo feature or capture/bubble I've read about but don't understand yet.

Thanks,
Richard
Dean
Top achievements
Rank 1
 answered on 11 Sep 2014
2 answers
100 views
I'm using a kendo angular grid on a page. The config is this:

$scope.gridData = new kendo.data.ObservableArray($scope.rowData);
          $scope.gridOptions = {
                    columns: [{
                        field: "itemType",
                        title: '<i class=\'fa fa-file-o\'></i>',
                        sortable: false,
                        width: 40
                    },{
                        field: "displayName",
                        title: "Name"
                    }, {
                        field: "owner",
                        title: "Owner"
                    }, {
                        field: "tags",
                        title: "Tags",
                        sortable: {
                            compare: function(data) {
                                return _.filter(data.tags, function(tagObj) {
                                    return (tagObj.state === 'Accepted' || tagObj.state === 'Suggested');
                                }).length;
                            }
                        }
                    }, {
                        field: "fileType",
                        title: "Content Type"
                    }, {
                        field: "size",
                        title: "Size",
                        width: 70
                    }, {
                        field: "lastModificationTime",
                        title: "Last Modified"
                    }],
                    sortable: {
                        mode: "single",
                        allowUnsort: false
                    },
                    columnMenu: true,
                    reorderable: true,
                    resizable: true,
                    selectable: "row",
                    pageable: {
                        pageSize: 25,
                        pageSizes: [25, 50, 100],
                        previousNext: true
                    },
                    rowTemplate: kendo.template($("#browseListGrid").html()),
                    dataSource: $scope.gridData
                };


So if I use this config to generate a grid, the pageSize defaults to the length of the $scope.gridData. If I use $scope.rowData as the dataSource, the pageSize actually works. I have absolutely no idea why this is the way it is...my understanding is that it should work with the array wrapped with ObservableArray. I have reproduced it in the following:

http://dojo.telerik.com/@yazdog8/IlEF





JSON
Top achievements
Rank 1
 answered on 10 Sep 2014
2 answers
477 views
Hello,

Let's say the grid makes a GET to api/tickets/2/lines to get the lines for ticket # 2, and the Web API controller cannot find that ticket.  It creates an HttpResponseMessage like this:

return Request.CreateErrorResponse(HttpStatusCode.NotFound, "Ticket not found: " + ticketId);

The raw HTTP response is:
HTTP/1.1 404 Not Found
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?QzpcRG90TmV0XFdlYlBvc1xXZWJQb3NcYXBpXHRpY2tldHNcMlxsaW5lcw==?=
X-Powered-By: ASP.NET
Date: Mon, 08 Sep 2014 00:25:57 GMT
Content-Length: 60
 
{"message":"Ticket not found: 2"}

In the grid's dataSource, I have defined an error event handler:
error: function(e) {
    if (e.errors) {
        alert(e.errors);
        this.cancelChanges();
    }
},
The handler gets called, but e.errors is undefined.  Looking at e, there I cannot find the error message, "Ticket not found: 2" anywhere.

How can I get to my message? 

Also, do you have a recommended approach for handling and displaying errors during grid operations (I was planning to use Toastr or similar to display the friendly message, in addition to obviously log details server-side).

Thanks,
Lars

Lars
Top achievements
Rank 1
 answered on 10 Sep 2014
1 answer
218 views
Just as my thread title suggests, I'm trying to find the best way/time to localize any static strings in my listview item templates.

For example:

<script type="script/x-kendo-template" id="meeting-item">
        <a data-item-id="#=meetingID#" href="\#meeting-details?id=#=meetingID#" data-transition="slide:left">
        <h3 class="time">#= startTime #</h3>
        <h3 class="counts"><span class="hc" data-i18n="dashboard.headCount"></span>: #=headCount# | Total: #=totalCount#</h3>
        <h2>#=meetingName#</h2>
        </a>
    </script>

I have i18next working great in my regular Kendo Web widgets but in my mobile implementation, I can't find a view even that will successfully parse/swap out my localized values (the data-i18n tag).

Any help would be greatly appreciated.
David
Top achievements
Rank 2
 answered on 10 Sep 2014
6 answers
578 views
We are currently having issues calling the WCF data service from the Kendo Data Source object. 

Is there something wrong with this initialization? When running the developer tool in browser it returns 400 Bad Request from the service. 

Please help...



var dataSource = new kendo.data.DataSource({
        type: "odata",
        transport:
        {
            read:
            {
                url: "http://localhost:49266/AmRiscOnlineService.svc/tblLocations",
                dataType: "jsonp",
                data: { accId: '@ViewBag.AccountId' },
            }
        },
    });
Oksana
Top achievements
Rank 1
Iron
 answered on 10 Sep 2014
1 answer
65 views
I have a kendo grid which has collection of checkboxes. It is working fine and collection is posted back to server. Problem is with paging/filtering. If applied, it returns null to controller on post

@(Html.Kendo().Grid(Model.secList)
.Name("secList")
.Columns(columns =>
{
columns.Bound(p => p.SecurityListId).Hidden().ClientTemplate("<input type='hidden' value = '#=SecurityListId #' name='secList[#= index(data)#].SecurityListId'/>");
columns.Bound(p => p.HubId).Hidden().ClientTemplate("<input type='hidden' value = '#=HubId #' name='secList[#= index(data)#].HubId'/>");
columns.Bound(p => p.FormId).Hidden().ClientTemplate("<input type='hidden' value = '#=FormId #' name='secList[#= index(data)#].FormId'/>");
columns.Bound(p => p.DataActionId).Hidden().ClientTemplate("<input type='hidden' value = '#=DataActionId #' name='secList[#= index(data)#].DataActionId'/>");
columns.Bound(p => p.Description).Width(250).Filterable(true);
columns.Bound(p => p.Action).Width(25).Sortable(false).Filterable(false)
.HeaderTemplate("<div align=center><input id='selectall' type='checkbox' checked= 'checked' /></div>")
.ClientTemplate("<div align=center><input type='checkbox' name='secList[#= index(data)#].Action' checked= 'checked' value = 'true'/> <input type='hidden' value = 'false' name='secList[#= index(data)#].Action'/></div> ");
})
.ToolBar(toolbar =>
{
toolbar.Template(@<text>
<div class="toolbar">
<label>Hubs:</label>
@(Html.Kendo().DropDownList()
.HtmlAttributes(new { style = "width:130px" })
.Name("ddlHubs")
.DataTextField("Description")
.DataValueField("HubId")
.DataSource(ds =>
{
ds.Read("GetAllHubs", "SecurityTemplate");
})
)
<label>Forms:</label>
@(Html.Kendo().DropDownList()
.HtmlAttributes(new { style = "width:150px" })
.Name("ddlforms")
.DataTextField("Description")
.DataValueField("FormId")
.DataSource(source => {
source.Read(read =>
{
read.Action("GetAllForms", "SecurityTemplate")
.Data("filterforms");
})
.ServerFiltering(true);
})
.Enable(false)
.AutoBind(false)
.CascadeFrom("ddlHubs"))
<span style="float:right">
<a onclick=' FilterList(this)' class="btn btn-primary round_blue"><i class="icon-search" onclick=' FilterList(this) '></i> &nbsp;Search</a></span>


</div>
</text>);
})
.DataSource(dataSource => dataSource
.Ajax()

.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.SecurityTemplateId);
model.Field(p => p.Description).Editable(false);
model.Field(p => p.Action).Editable(true);

}))
.Sortable()
.Scrollable()
.Filterable()
.HtmlAttributes(new { style = "height:320px;" }))

Any Clue?
Petur Subev
Telerik team
 answered on 10 Sep 2014
5 answers
94 views
Hi,

With Kendo Mobile version 2014.1.318, I'm using the following meta tag to get rid of Mobile Safari's toolbars in iOS7.1 (iPhone 4):

<meta name="viewport" content="minimal-ui" />

Changing orientation from portrait to landscape with this meta tag in place leaves the bottom part of the screen unused or, in other words, messes up the view's scroll position so that the top part of the screen gets hidden and "blank" content is shown at the bottom of the page.

This won't occur if the app is loaded from a home screen web app shortcut (toolbars are hidden automatically).

Slightly modified example code from Telerik's demos below (attached too). 

Original: http://demos.telerik.com/kendo-ui/mobile/layout/index.html

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="minimal-ui" />
    <style>html { font-size: 12px; font-family: Arial, Helvetica, sans-serif; }</style>
    <title></title>
</head>
<body>
    <div data-role="view" data-layout="layout" data-show="layoutShow" id="layoutView">
    <p>
        This examples shows the platform specific layouts. Change the OS to see how the header and footer changes.
    </p>
    <p>
        With Kendo Mobile version 2014.1.318, I'm using the following meta tag to get rid of Mobile Safari's toolbars in iOS7.1 (iPhone 4):
    </p>
    <p>
        <code><meta name="viewport" content="minimal-ui" /></code>
    </p>
    <p>
        Changing orientation from portrait to landscape with this meta tag in place leaves the bottom part of the screen unused or, in other words, messes up the view's scroll position so that the top part of the screen gets hidden and "blank" content is shown at the bottom of the page.
    </p>
</div>
 
<div data-role="layout" data-id="layout" data-platform="ios">
    <header data-role="header">
        <div data-role="navbar">
            <a data-align="right" data-role="button" class="nav-button" href="#/">Index</a>
            <span data-role="view-title">iOS Platform</span>
        </div>
    </header>
    <footer data-role="footer">
        <div data-role="tabstrip">
            <a data-icon="contacts">Profile
            </a><a data-icon="settings">Settings</a>
        </div>
    </footer>
</div>
 
<div data-role="layout" data-id="layout" data-platform="android">
    <header data-role="header">
        <div data-role="navbar">
            <span data-role="view-title">Android Platform</span>
            <a data-align="right" data-role="button" class="nav-button" href="#/">Index</a>
        </div>
    </header>
 
    <footer data-role="footer">
        <div data-role="tabstrip">
            <a data-icon="history">Sales</a>
            <a data-icon="settings">Settings</a>
        </div>
    </footer>
</div>
 
<div data-role="layout" data-id="layout" data-platform="blackberry">
    <header data-role="header">
        <div data-role="navbar">
            <a data-align="right" data-role="button" class="nav-button" href="#/">Index</a>
            <span data-role="view-title">BlackBerry platform</span>
        </div>
    </header>
 
    <footer data-role="footer">
        <div data-role="tabstrip">
            <a data-icon="favorites">Rating</a>
            <a data-icon="settings">Settings</a>
        </div>
    </footer>
</div>
 
<div data-role="layout" data-id="layout" data-platform="wp">
    <header data-role="header">
        <div data-role="navbar">
            <a data-align="right" data-role="button" class="nav-button" href="#/">Index</a>
            <span data-role="view-title">Windows Phone platform</span>
        </div>
    </header>
 
    <footer data-role="footer">
        <div data-role="tabstrip">
            <a data-icon="home">Home</a>
            <a data-icon="globe">Global</a>
        </div>
    </footer>
</div>
 
<style scoped>
    #layoutView .km-view-title
    {
        visibility: inherit;
    }
 
    .km-android #layoutView .km-view-title
    {
        display: block;
        position: static;
    }
</style>
 
 
<script>
    var app = new kendo.mobile.Application(document.body);
</script>
</body>
</html>


Petyo
Telerik team
 answered on 10 Sep 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
Map
Drag and Drop
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
ScrollView
Switch
TextArea
BulletChart
Licensing
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
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?