Telerik Forums
Kendo UI for jQuery Forum
3 answers
651 views
Hi Support team,

I encounter this issue while integrating Grid into my application. Our clients provide us a fix Data API like below:

http://11.11.11.11/accountservice.aspx?PageSize=100  get the page which currentpage = 0 ( seqNo: 1~100)
http://11.11.11.11/accountservice.aspx?PageSize=100&CurrentPage=2 get third page (seqNo: 201~300)
http://11.11.11.11/accountservice.aspx?PageSize=100&GetTotal=true get the total count number

The datasource is in JSON format:
[ { UEN:"ST12345",CustName:"AA",Email:"" }, ... ] more than 10K records like this on the server.

Could you please help me with below grid features:
- ServerPaging
- AutoBinding
- Server Sorting

Thanks & Regards,
Bach
Matt Barker
Top achievements
Rank 1
 answered on 11 Sep 2014
7 answers
493 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
703 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
214 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
234 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
135 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
509 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
252 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
611 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
83 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
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?