Hello,
I'm using scheduler in a very simple mode - a read-only month view. I'd like to read from the server every time the user navigates. I have found some sample code on this forum from 2013, however the latest library code is a bit different.
Anyway, I have an ALMOST working solution. I have serverFiltering = true, and my Controller method is set up to work with DataSource filtering:
public virtual JsonResult HistoryData(Guid id, [DataSourceRequest] DataSourceRequest request)
However, the scheduler JS library fails because it expects the data to some back in a simple list format. The controller is obviously returning a "filterable" format like so:
Data->
Total:1
Filters: ...
Errors: ...
Data: [...]
So my question is, if we're using serverFilterable flag to force the reads, shouldn't I be able to use [DataSourceRequest] in my controller?
Could you please provide an up-to-date MVC project sample for this scenario?
Many thanks.
Hello,
I'm playing with Kendo Grid and there is getOptions() method. I want to autosave user config after a change (after debouncing it). Cannot find a propper event. How can I get an event when user changes its configuration?
Best regards,
I have an MVC view of 3 Kendo UI Grids, along with an Export to Excel button to export the data from the 3 grids to 3 Excel worksheets.
The following is a sample of the page script (with column detail removed for simplicity).
When I execute the Export button, I get a Javascript error "Unable to get property 'saveAsExcel' of undefined or null reference" at the line identified below with //##errorLine##. So for some reason the grid references can not be determined.
What am I missing here?
<script type="text/javascript">
// used to sync the grid exports
var promises = [
$.Deferred(),
$.Deferred(),
$.Deferred()
];
</script>
<div style="text-align:center;">
@(Html.Kendo().Grid(Model)
.Name("HccWp")
.Columns(columns =>
{
...
})
.ClientDetailTemplateId("outOfBalanceDetailTemplate")
.Sortable(sortable => sortable.SortMode(GridSortMode.SingleColumn).AllowUnsort(true))
.Resizable(resizable => resizable.Columns(true))
.AutoBind(true)
.Events(e => e
.DataBound(@<text>function(e) {onDataBound(e, "HccWp")}</text>)
.ExcelExport(@<text>function(e) {e.preventDefault(); promises[0].resolve(e.workbook);}</text>)
)
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
...
})
)
)
</div>
<div style="text-align:center;">
@(Html.Kendo().Grid(Model)
.Name("HccPr")
.Columns(columns =>
{
...
})
.ClientDetailTemplateId("outOfBalanceDetailTemplate")
.Sortable(sortable => sortable.SortMode(GridSortMode.SingleColumn).AllowUnsort(true))
.Resizable(resizable => resizable.Columns(true))
.AutoBind(true)
.Events(e => e
.DataBound(@<text>function(e) {onDataBound(e, "HccPr")}</text>)
.ExcelExport(@<text>function(e) {e.preventDefault(); promises[1].resolve(e.workbook);}</text>)
)
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
...
})
)
)
</div>
<div style="text-align:center;">
@(Html.Kendo().Grid(Model)
.Name("PointWp")
.Columns(columns =>
{
...
})
.ClientDetailTemplateId("outOfBalanceDetailTemplate")
.Sortable(sortable => sortable.SortMode(GridSortMode.SingleColumn).AllowUnsort(true))
.Resizable(resizable => resizable.Columns(true))
.AutoBind(true)
.Events(e => e
.DataBound(@<text>function(e) {onDataBound(e, "PointWp")}</text>)
.ExcelExport(@<text>function(e) {e.preventDefault(); promises[2].resolve(e.workbook);}</text>)
)
.DataSource(dataSource => dataSource
.Ajax()
//.PageSize(20)
.Model(model =>
{
...
})
)
)
</div>
<br />
<div>
<button id="export" class="k-button"><span class="k-icon k-i-excel"></span> Export to Excel</button>
</div>
<script type="text/javascript">
$("#export").click(function(e){
// trigger export of the HccWp grid
$("#HccWP").data("kendoGrid").saveAsExcel(); //##errorLine##
// trigger export of the HccPr grid
$("#HccPR").data("kendoGrid").saveAsExcel();
// trigger export of the PointWp grid
$("#PointWP").data("kendoGrid").saveAsExcel();
// wait for all exports to finish
$.when.apply(null, promises)
.then(function (hccWpWorkbook, hccPrWorkbook, pointWpWorkbook) {
// create a new workbook using the sheets of the 3 workbooks
var sheets = [
hccWpWorkbook.sheets[0],
hccPrWorkbook.sheets[0],
pointWpWorkbook.sheets[0]
];
sheets[0].title = "HccWP";
sheets[1].title = "HccPR";
sheets[2].title = "PointWP";
var workbook = new kendo.ooxml.Workbook({
sheets: sheets
});
// save the new workbook
kendo.saveAs({
dataURI: workbook.toDataURL(),
fileName: "BCBalancing.xlsx"
})
});
});
</script>
have multiple series for pie chart ? (attached pic )
Hi
I am using kendo-Dialog for shown the Employee Details. In Chrome or Mozilla when I use CTRL+A all the details in the dialog was selecting correctly. But in IE browser when I use CTRL+A the Select All keys are working but the values are not selected in the same Dialog for IE Browser.
I have used below code:
this.$(".employee").keydown(function (e) {
if (e.ctrlKey) {
if (e.keyCode == 65 || e.keyCode == 97) { // 'A' or 'a'
alert("Alert");
$(this).select();
}
}
});
But its not working in IE 11.
Here's an example of what I'm working with: http://dojo.telerik.com/uYidA/7
I'm making a grid that is using autoSync and in cell editing for updating rows and allowing the rows to be reordered with kendo sortable as well.
The issue I'm running into is whenever you try to add a new record I'm getting this error "Uncaught TypeError: Cannot read property 'closest' of undefined" which is due to autoSync trying to find a row that isn't currently there yet.
What I'm wondering is if there's a way to add a row using the edit/update/delete whenever I'm using batch and in cell editing?
Basically I'm wanting to be able to update rows with in cell editing using autoSync to save as you go, but whenever you add a new record to use inline editing so that I'm not creating a blank record in the database and then updating that blank record?
Let me know if that makes sense! I know it's a little confusing
Thanks!
Hello,
There is the following issue.
I cant drag from one grid to another when the second has no data.
here is the dojo: http://dojo.telerik.com/UZaMU
Trying to run some unit tests of our Kendo components which are wrapped in Marionette Views and am getting a "kendoGrid is not a function" error, and am not sure why.
The kendo global is attached to window, and all the kendo* functions do come up as undefined in the debugger.
Here is the load order from the body of the karma debugger:
<
script
type
=
"text/javascript"
src
=
"/base/node_modules/jasmine-core/lib/jasmine-core/jasmine.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/node_modules/karma-jasmine/lib/boot.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/node_modules/karma-jasmine/lib/adapter.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/web-libs-common/src/main/resources/META-INF/resources/static/js/lib/jquery/jquery.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/web-libs-common/src/main/resources/META-INF/resources/static/js/lib/kendoui/kendo.all.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/node_modules/requirejs/require.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/node_modules/karma-requirejs/lib/adapter.js"
crossorigin
=
"anonymous"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/base/test-main.js"
crossorigin
=
"anonymous"
></
script
>
jQuery does not get loaded twice, BUT setting a break point in one of the tests and then inspecting it shows another jQuery script tag in the head element which is gone after all the tests run/blow up.
My karma.conf.js, test-main.js, and require.js config are here if needed:
StackOverflow Post
Any help would be greatly appreciated!