Telerik Forums
Kendo UI for jQuery Forum
10 answers
1.3K+ views
how can i Export  to excel kendo Grid in button click event.Thanks
Mohan
Top achievements
Rank 1
 answered on 19 Jul 2013
1 answer
826 views
I'm trying to calculate a "Total" column while the user types the quantity through a input inside the template of the grid. I've been stuck here for a while now.

var ds = new kendo.data.DataSource({
                type: "aspnetmvc-ajax",
                transport: {
                    read: "Home/Products_Read"
                },
                schema: {
                    data: "data",
                    total: "total",
                    model: {
                        id: "products",
                        fields: {
                            Code: { editable: false },
                            Number: { editable: false },
                            Name: { editable: false },
                            Supplier: { editable: false },
                            Price: { editable: false, type: "number", format: "{0:n}" },
                            UnitStock: { editable: false },
                            UnitBasic: { editable: false },
                            Quantity: { editable: true, type: "number" },
                            Total: { editable: true, type: "number", format: "{0:n}" }
                        }
                    }
                },
                pageSize: 15,
                serverPaging: true,
                serverFiltering: true,
                serverSorting: true
            });
 
            var gridResult = $("#grid").kendoGrid({
                dataSource: ds,
                selectable: "row",
                sortable: true,
                pageable: true,
                columns: [
                    { field: "Code", title: "Code", width: "100px" },
                    { field: "Number", title: "Number", width: "100px" },
                    { field: "Name", title: "Name" },
                    { field: "Supplier", title: "Supplier", width: "100px" },
                    { field: "Price", title: "Price", width: "100px", format: "{0:n}" },
                    { field: "UnitStock", title: "Unit", width: "100px" },
                    { field: "Quantity", title: "Quantity", width: "100px", template: '<input class="someInput" name=#=Code# value=#=Quantity# />' },
                    { field: "Total", title: "Total", width: "100px", template: '#=Price*Quantity#' },
                    ]
            });
 
            $('.someInput').on('change', function () {               
                for (var i = 0; i < gridResult.dataSource.data().length; i++) {
                    if (parseInt(gridResult.dataSource.data()[i].Code) == parseInt($(this).attr('name'))) {
                        gridResult.dataSource.data()[i].Quantity.Set($(this).val());
                    }
                }
                gridResult.refresh();
            });
Dimiter Madjarov
Telerik team
 answered on 19 Jul 2013
13 answers
359 views

Hi,

I have extended my Kendo UI Grid with the kendo.ui.Grid.extend/kendo.ui.plugin functionality as per this article:

http://www.aspnetwiki.com/page:kendo-ui-grid-export-excel

Everything works great except it causes the loss of grouping and reordering  - the Drag and Drop no longer works.

I suspect it may have to do with the  shift from:
$("#myGrid").data("kendoGrid");
to

$("#myGrid").data("kendoExcelGrid");

or is there something else going on with the Drag and Drop?


Cheers,

Kori

Mohan
Top achievements
Rank 1
 answered on 19 Jul 2013
5 answers
171 views
If I go to the Custom Downloader (http://www.kendoui.com/custom-download.aspx), the dropdown is set for the 716 build but no checkboxes display (IE9, Chrome). Changing to another selection displays them and then I switched back to 716. Select some checkboxes but the Download button does not display.

Switch back to say 514 and select some checkboxes and the download button displays and the size is updated as you select more checkboxes. Switch back to 716 and the download button remains but selecting checkboxes does not any longer update the size or build the expected download file.

Could you have the downloader fixed?

Thanks,
Gary Davis
Sebastian
Telerik team
 answered on 19 Jul 2013
2 answers
149 views
If you have a view which does an app.navigate() when shown, the drawer breaks.  The drawer will show the previous view instead of the drawer on the view navigated to.

In my case, I had a login remote view which would simply do an app.navigate() to the home view if the user was already logged in.  I did this on data-before-show.  The issue is something with timing.  I ended up putting a setTimeout() on the app.navigate() to 1 second and then the navigation & drawer worked fine after.

@if (Request.IsAuthenticated)
{
    AppsWebAppContext context = (AppsWebAppContext)ViewBag.AppContext;
    string displayName = context.User.DisplayName;
    string avatarUrl = (context.User.HasAvatar) ? context.User.AvatarSmallUrl : Url.GetUrlRoot() + "/Images/NoAvatar/small.jpg";
     
    <div id="viewLogin" data-title="Login" data-role="view" data-before-show="viewLoginOnBeforeShow" data-hide="onHide">
        <script type="text/javascript">
            function viewLoginOnBeforeShow(e) {
                showLoading();
 
                onBeforeShow(e);
 
                $("#userAvatar").attr("src", "@avatarUrl");
                $("#userDisplayName").text("@displayName");
 
                setTimeout(function () { navigateHome(); hideLoading(); }, 1000);
            }
        </script>
    </div>
}
Bill
Top achievements
Rank 1
 answered on 19 Jul 2013
1 answer
117 views
I'm trying to figure out how to bind the data to Kendo Sparkline through AngularJS, which works fine with normal HTML page by including all the required kendo styles and scirpting files to that page. Here is the original code that I have been working...

HTML Code
<table class="table">
<tbody>
<tr>
<td>
<span id="press-log"></span>
</td>
</tr>
</tbody>
</table>

Angular Controller Code:

<script type="text/javascript">
angular.module('demoApp').controller('cc', ['$scope', function ($scope) {
$scope.createSparklines = function () {
$("#press-log").kendoSparkline({
type: "area",
data: [
71, 70, 69, 68, 65, 60, 55, 55, 50, 52,
73, 72, 72, 71, 68, 63, 57, 58, 53, 55,
63, 59, 61, 64, 58, 53, 48, 48, 45, 45,
63, 64, 63, 67, 58, 56, 53, 59, 51, 54
]
});
}

$scope.createSparklines();

} ]);
</script>

The Sparkline doesn't fires with the static values and even with an array object, Can you help me on this.
Burke
Telerik team
 answered on 19 Jul 2013
1 answer
82 views
Since I have upgraded to the latest kendoui package this morning (2013.2.716),

one of my grids stopped binding.

The view is as follows in asp.net mvc:

@(Html.Kendo().Grid<IPMC.Web.InventoryQueryService.ProductStatistic>()
    .Name("ProductStatisticsGrid")
    .Columns(columns =>
    {
        columns.Bound(o => o.ClientProductReference).Title("Product Ref").Width(50);
        columns.Bound(o => o.ProductDescription).Title("Description").Width(50);
        
        columns.Bound(o => o.CompletedCasesCount).Title("CCC").Width(50);
        columns.Bound(o => o.CompletedCasesTodayCount).Title("CCC Today").Width(50);
        columns.Bound(o => o.CompletedCasesYesterdayCount).Title("CCC Yesterday").Width(50);
        columns.Bound(o => o.CompletedCases1WeekCount).Title("CCC Week").Width(50);
        columns.Bound(o => o.CompletedCases1MonthCount).Title("CCC Month").Width(50);
        columns.Bound(o => o.PercentageOfAllCompletedCases).Title("CCC").Format("{0:P2}").Width(50);

        columns.Bound(o => o.LanesAssignedToProductCount).Title("Lane Count").Width(50);
        columns.Bound(o => o.CasesStoredInLanesCount).Title("Lanes Cases").Width(50);
        columns.Bound(o => o.YoungestCaseEnteredInventoryTimeStampLocal).Title("Youngest Case Date").Format("{0:yyyy-MM-dd}").Width(90);
        columns.Bound(o => o.OldestCaseEnteredInventoryTimeStampLocal).Title("Oldest Case Date").Format("{0:yyyy-MM-dd}").Width(90);

        columns.Bound(o => o.CasesOnSequenceConveyorsFromInfeedCount).Title("SC In").Width(50);
        columns.Bound(o => o.CasesOnSequenceConveyorsToOutfeedCount).Title("SC Out").Width(50);

        columns.Bound(o => o.CasesSchedueledInReplenishmentsCount).Title("Replen Cases").Width(50);
        columns.Bound(o => o.CasesSchedueledToCompleteAccordingToCaseSequenceCount).Title("Case Seq todo").Width(50);
    })
    .Groupable(t => t.Enabled(false))
    .Filterable()
    .Sortable()
    .Pageable(p => p.Refresh(true))
    .DataSource(db => db.Ajax().Read("_GetProductStatistics", "Inventory").ServerOperation(false).PageSize(100).Sort(s => s.Add("ClientProductReference")))
)


And the data received by the grid in the ajax call is :
{"Data":[{"YoungestCaseEnteredInventoryTimeStampLocal":"\/Date(1374090930460)\/","OldestCaseEnteredInventoryTimeStampLocal":"\/Date(1374090874477)\/","ProductId":"product-702553","ProductDescription":"4X6 CANETTE 355ml Corona","ClientProductReference":"702553","CompletedCasesCount":0,"CompletedCasesTodayCount":0,"CompletedCasesYesterdayCount":0,"CompletedCases1WeekCount":0,"CompletedCases1MonthCount":0,"PercentageOfAllCompletedCases":NaN,"CasesOnSequenceConveyorsToOutfeedCount":1,"CasesOnSequenceConveyorsFromInfeedCount":2,"CasesStoredInLanesCount":44,"LanesAssignedToProductCount":3,"YoungestCaseEnteredInventoryTimeStampUTC":"\/Date(1374090930460)\/","OldestCaseEnteredInventoryTimeStampUTC":"\/Date(1374090874477)\/","CasesSchedueledInReplenishmentsCount":53,"CasesSchedueledToCompleteAccordingToCaseSequenceCount":1},{"YoungestCaseEnteredInventoryTimeStampLocal":"\/Date(1374090930655)\/","OldestCaseEnteredInventoryTimeStampLocal":"\/Date(1374090875952)\/","ProductId":"product-701267","ProductDescription":"3X8 CAN Dry Cold Shot","ClientProductReference":"701267","CompletedCasesCount":0,"CompletedCasesTodayCount":0,"CompletedCasesYesterdayCount":0,"CompletedCases1WeekCount":0,"CompletedCases1MonthCount":0,"PercentageOfAllCompletedCases":NaN,"CasesOnSequenceConveyorsToOutfeedCount":2,"CasesOnSequenceConveyorsFromInfeedCount":2,"CasesStoredInLanesCount":43,"LanesAssignedToProductCount":3,"YoungestCaseEnteredInventoryTimeStampUTC":"\/Date(1374090930655)\/","OldestCaseEnteredInventoryTimeStampUTC":"\/Date(1374090875952)\/","CasesSchedueledInReplenishmentsCount":53,"CasesSchedueledToCompleteAccordingToCaseSequenceCount":2},{"YoungestCaseEnteredInventoryTimeStampLocal":"\/Date(1374090930806)\/","OldestCaseEnteredInventoryTimeStampLocal":"\/Date(1374090877131)\/","ProductId":"product-702707","ProductDescription":"1.18 L DRY 7.5","ClientProductReference":"702707","CompletedCasesCount":0,"CompletedCasesTodayCount":0,"CompletedCasesYesterdayCount":0,"CompletedCases1WeekCount":0,"CompletedCases1MonthCount":0,"PercentageOfAllCompletedCases":NaN,"CasesOnSequenceConveyorsToOutfeedCount":1,"CasesOnSequenceConveyorsFromInfeedCount":2,"CasesStoredInLanesCount":43,"LanesAssignedToProductCount":3,"YoungestCaseEnteredInventoryTimeStampUTC":"\/Date(1374090930806)\/","OldestCaseEnteredInventoryTimeStampUTC":"\/Date(1374090877131)\/","CasesSchedueledInReplenishmentsCount":54,"CasesSchedueledToCompleteAccordingToCaseSequenceCount":1},{"YoungestCaseEnteredInventoryTimeStampLocal":"\/Date(1374090930935)\/","OldestCaseEnteredInventoryTimeStampLocal":"\/Date(1374090878032)\/","ProductId":"product-700231","ProductDescription":"1.18 L Molson Dry","ClientProductReference":"700231","CompletedCasesCount":0,"CompletedCasesTodayCount":0,"CompletedCasesYesterdayCount":0,"CompletedCases1WeekCount":0,"CompletedCases1MonthCount":0,"PercentageOfAllCompletedCases":NaN,"CasesOnSequenceConveyorsToOutfeedCount":1,"CasesOnSequenceConveyorsFromInfeedCount":2,"CasesStoredInLanesCount":42,"LanesAssignedToProductCount":3,"YoungestCaseEnteredInventoryTimeStampUTC":"\/Date(1374090930935)\/","OldestCaseEnteredInventoryTimeStampUTC":"\/Date(1374090878032)\/","CasesSchedueledInReplenishmentsCount":55,"CasesSchedueledToCompleteAccordingToCaseSequenceCount":1},{"YoungestCaseEnteredInventoryTimeStampLocal":"\/Date(1374090930873)\/","OldestCaseEnteredInventoryTimeStampLocal":"\/Date(1374090879324)\/","ProductId":"product-703235","ProductDescription":"1.18 L Big 10.1","ClientProductReference":"703235","CompletedCasesCount":0,"CompletedCasesTodayCount":0,"CompletedCasesYesterdayCount":0,"CompletedCases1WeekCount":0,"CompletedCases1MonthCount":0,"PercentageOfAllCompletedCases":NaN,"CasesOnSequenceConveyorsToOutfeedCount":1,"CasesOnSequenceConveyorsFromInfeedCount":2,"CasesStoredInLanesCount":41,"LanesAssignedToProductCount":3,"YoungestCaseEnteredInventoryTimeStampUTC":"\/Date(1374090930873)\/","OldestCaseEnteredInventoryTimeStampUTC":"\/Date(1374090879324)\/","CasesSchedueledInReplenishmentsCount":56,"CasesSchedueledToCompleteAccordingToCaseSequenceCount":1},{"YoungestCaseEnteredInventoryTimeStampLocal":"\/Date(1374090930694)\/","OldestCaseEnteredInventoryTimeStampLocal":"\/Date(1374090881743)\/","ProductId":"product-704167","ProductDescription":"GROSSE CAN 710 ML Export","ClientProductReference":"704167","CompletedCasesCount":0,"CompletedCasesTodayCount":0,"CompletedCasesYesterdayCount":0,"CompletedCases1WeekCount":0,"CompletedCases1MonthCount":0,"PercentageOfAllCompletedCases":NaN,"CasesOnSequenceConveyorsToOutfeedCount":2,"CasesOnSequenceConveyorsFromInfeedCount":3,"CasesStoredInLanesCount":39,"LanesAssignedToProductCount":3,"YoungestCaseEnteredInventoryTimeStampUTC":"\/Date(1374090930694)\/","OldestCaseEnteredInventoryTimeStampUTC":"\/Date(1374090881743)\/","CasesSchedueledInReplenishmentsCount":56,"CasesSchedueledToCompleteAccordingToCaseSequenceCount":2},{"YoungestCaseEnteredInventoryTimeStampLocal":null,"OldestCaseEnteredInventoryTimeStampLocal":null,"ProductId":"product-700388","ProductDescription":"Grosse 650 ML Heineken","ClientProductReference":"700388","CompletedCasesCount":0,"CompletedCasesTodayCount":0,"CompletedCasesYesterdayCount":0,"CompletedCases1WeekCount":0,"CompletedCases1MonthCount":0,"PercentageOfAllCompletedCases":NaN,"CasesOnSequenceConveyorsToOutfeedCount":0,"CasesOnSequenceConveyorsFromInfeedCount":0,"CasesStoredInLanesCount":0,"LanesAssignedToProductCount":0,"YoungestCaseEnteredInventoryTimeStampUTC":null,"OldestCaseEnteredInventoryTimeStampUTC":null,"CasesSchedueledInReplenishmentsCount":100,"CasesSchedueledToCompleteAccordingToCaseSequenceCount":1}],"Total":7,"AggregateResults":null,"Errors":null}


Any thoughts ???
Vladimir Iliev
Telerik team
 answered on 19 Jul 2013
5 answers
191 views
I have a grid that is configured for a Model, and records are edited/added by a popup editor that displays a custom template that contains cascading comboboxes.  
It works beautifully for adding a new record.
However, when editing an existing record,  the main combobox is loaded but the cascade combobox is not.
It happens because the script that gets the parameters for the Action gets the value from the main combobox (that hasn't been loaded) 

How to solve it?
Petur Subev
Telerik team
 answered on 19 Jul 2013
1 answer
361 views
I'm having trouble using data-attribute initialization for the grid.

I created a jsbin using the KendoUI web sample code, with "dataSource", "columns", and "pageable" moved to global var's.
http://jsbin.com/uwicus/1/

As you can see in the jsbin, the grid works correctly when initialized by

<script>
    $(document).ready(function() {
        $("#grid").kendoGrid({
            dataSource: ds,
            height: 430,
            scrollable: true,
            sortable: true,
            filterable: true,
            pageable: pageableProperties,
            columns: columnList
        });
    });
</script>
However, when I switch to the equivalent data-attribute initialization, it no longer works correctly
<div
    id="grid"
    data-role="grid"
    data-source="ds"
    data-height="430"
    data-scrollable="true"
    data-sortable="true"
    data-filterable="true"
    data-pageable="pageableProperties"
    data-columns="columnList"
/>

Please let me know what I'm missing here.  Thx.
Alexander Valchev
Telerik team
 answered on 19 Jul 2013
2 answers
89 views
How can I update my project to use Kendo UI Q2 2013 and use the Drawer widget?.

I have updated the files: kendo.mobile.min.js and kendo.mobile.all.min.css downloaded from the trial version (Kendo UI Beta v2013.2.716) but I can't make Drawer to work in the simulator.
Steve
Telerik team
 answered on 19 Jul 2013
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
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
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?