Telerik Forums
UI for ASP.NET MVC Forum
2 answers
101 views
I cant get labels to render correctly.

series.Pie(Function(model) model.Value, Function(model) model.Key).Labels(Function(labels) labels.Template("#= Key #: #= Value #").Visible(True))

This gives me an error "JavaScript runtime error: 'Value' is undefined"
if I remove Value and use "#= Key #" I get I get a label like "[object Key]"

Thanks


Alan Mosley
Top achievements
Rank 1
 answered on 04 Jun 2014
1 answer
71 views
Wondering where the MVC samples went to on the Kendo component demo pages?  

It was an excellent quick reference for the MVC Wrappers fluent syntax.

Also hopping this does not signify the beginnings of sun-setting MVC support, please confirm this is not the case!

http://demos.telerik.com/kendo-ui/ 
Sebastian
Telerik team
 answered on 04 Jun 2014
1 answer
93 views
I am trying to refresh a chart using ajax, but cant seem to send data. Where am I going wrong, I have tried many things to pass data, but all have failed
I am trying send dates

$(document).ready(function () {
 
 
    var pieUrl = "@pieUrl";
    var dataSource = new kendo.data.DataSource({
        transport: {
            read: {
                url: pieUrl,
                dataType: "json"
            }
        }
    });
    dataSource.read({"FromDate": kendo.toString($("#FromDate").data("kendoDatePicker").value(), "dd/MM/yyyy"), "ToDate": kendo.toString($("#ToDate").data("kendoDatePicker").value(), "dd/MM/yyyy") })
 
 
    var chart = $("#EnrolmentsValue").data("kendoChart");
    chart.setDataSource(dataSource);
    chart.redraw();
    chart.refresh();
})

My chart
@code
 
    Dim EnrolmentsValue As Kendo.Mvc.UI.Chart(Of BO.Models.Statistics.KeyValue) = _
                Html.Kendo().Chart(Of BO.Models.Statistics.KeyValue).Name("EnrolmentsValue").Title(Sub(title)
                                                                                                           title.Text("Share of Internet Population Growth, 2007i - 2012").Position(ChartTitlePosition.Bottom)
                                                                                                   End Sub).
                                                               Legend(Sub(legend)
                                                                              legend.Visible(False)
                                                                      End Sub).
                                                               Series(Sub(series)
                                                                              series.Pie(Nothing).Labels(Sub(labels) labels.Template("#= Key #: #= Value#%").
                                                                                         Background("transparent").Visible(True)).StartAngle(150)
                                                                      End Sub).Tooltip(Function(tooltip) tooltip.Visible(True).Format("{0}%")).AutoBind(True).
                                                                      DataSource(Sub(ds)
                                                                                         ds.Read(Function(read) read.Action("getsalesbyfranchisee", "statistics", New With {.area = String.Empty}))
                                                                                 End Sub)
 
 
    EnrolmentsValue.Render()
 
 
    Dim pieUrl As String = Url.Action("getsalesbyfranchisee", "statistics", New With {.area = String.Empty})
 
end code





Alan Mosley
Top achievements
Rank 1
 answered on 03 Jun 2014
5 answers
126 views
I need to display 84 columns in a grid. The first two columns are required to be locked. If the columns are setup as locked they don't display the correct title but if I remove the locked property they do.

It's not displaying the correct title but has the correct data.
ALEXIS V.
Top achievements
Rank 1
 answered on 03 Jun 2014
6 answers
387 views
Hi

i'm working on a script where i need to add/remove aggregation dynamically (i have own gui to control aggregation on appropriate fields)

add aggregation was ok by using
dataSource.group(groups);
dataSource.aggregate(aggregates);
grid.columns[parseInt(column)].groupFooterTemplate = aggr + " #=" + aggr.toLowerCase() + "#";
grid.setDataSource(dataSource);

this will remove aggregation and grouping:
dataSource.group([]);
dataSource.aggregate([]);
grid.columns[parseInt(column)].groupFooterTemplate = "";
grid.setDataSource(dataSource);

but if i try to group again after removing i get the following error:
Uncaught TypeError: undefined has no properties, but by not setting the template to an empty string i get a $aggr is not defined.

Have can i remove aggregation, reset the footer template so i don't get the undefined errors and still have grouping?

Dan-Petter
Top achievements
Rank 1
 answered on 03 Jun 2014
5 answers
432 views
Dear All,

How to create the New  Record , Updated Record, Delete Record and View Records  Using Grid controls with validations( required filed ).

Please give me the sample projects......

thanks&regards,
srinivasulu
Petur Subev
Telerik team
 answered on 03 Jun 2014
4 answers
105 views
I have a problem with IE10. Explorer hangs when tiles can not read UrlTemplateId. If UrlTemplateId is not a valid IP address or no connection to the Internet. In FireFox and Chrome  all ok! 

How can I solve this problem with IE?
Hristo Germanov
Telerik team
 answered on 03 Jun 2014
4 answers
1.6K+ views
I need to allow only a file to be uploaded. Change from upload files to upload file.
Dimiter Madjarov
Telerik team
 answered on 03 Jun 2014
2 answers
155 views


Hi Sir

I used async upload, on my view I used the event select and upload function. the problem is the request not sent to the Action once I uploaded a file.

Here's my code snippet.



 $(document).ready(function () {



var lookup = $("#ComboLookupTable").data("kendoComboBox");
$("#get").click(function () {
});

$("#files").kendoUpload({
async: {
saveUrl: "UploadFile/Lookup",
removeUrl: "remove",
autoUpload: false,
value: 'Import'
},
multiple: false,
progress: function (e) {

},
upload: function (e) {
// debugger;
var kendoWindow = $("<div />").kendoWindow({
title: "Replace Lookup Table Data?",
resizable: false,
modal: true
});

kendoWindow.data("kendoWindow")
.content($("#delete-confirmation").html())
.center().open();

kendoWindow
.find(".delete-confirm,.delete-cancel")
.click(function () {
if ($(this).hasClass("delete-cancel")) {

e.preventDefault();
// kendoWindow.data("kendoWindow").close();
//return;
}
else {
e.data = { additional: $("#ComboLookupTable").val() };
}

kendoWindow.data("kendoWindow").close();
})
//.end()



// ---------

//e.data = { additional: $("#ComboLookupTable").val() };
},
select: function (e) {
// debugger;
e.data = { additional: $("#ComboLookupTable").val() };
},
localization: {
select: "Select a file",
uploadSelectedFiles: "Import",
remove: "Remove"
}
//upload: onUpload
//select: onSelect

});
});


Here's my controller (action)

'Upload File (excel)
<HttpPost> _
Public Function UploadFile(ByVal files As HttpPostedFileBase, ByVal additional As String) As ActionResult

Dim data = (New ExcelReader()).ReadExcel(files)

Select Case additional
Case FuelEfficiencyViewModel.Table.Lookup.ConversionFactors
Return View()
Case FuelEfficiencyViewModel.Table.Lookup.ElectricalRegionalEmissionFactors
Return View()
Case FuelEfficiencyViewModel.Table.Lookup.ElectricalSubRegionEmissionFactors
Return View()
Case FuelEfficiencyViewModel.Table.Lookup.FuelEfficiecies
Dim ent As New List(Of ViewModel.FuelEfficiencyViewModel.Create)

For Each datarow In data.DataRows
ent.Add(New ViewModel.FuelEfficiencyViewModel.Create With {.VehicleClass = datarow(0).ToString, _
.FuelEfficiencyValue = Convert.ToDecimal(datarow(1)), _
.CreatedBy = Session(LocalConstant.Ses_UserID), _
.CreatedDate = Now.Date})
Next
_fuelefficiencyRepository.Create(ent)
Return View()
Case FuelEfficiencyViewModel.Table.Lookup.GlobalEmissionFactors
Return View()
Case FuelEfficiencyViewModel.Table.Lookup.GlobalWarmingPotential
Return View()

End Select


'Session(LocalConstant.SessionExcelData) = resultList

Return View("Index", data.Status)
'Return View()
End Function



Thank you in advance and God bless.
Dimiter Madjarov
Telerik team
 answered on 03 Jun 2014
1 answer
283 views
Hi All,

I have parent and child grid. When user create new, there must be 1 record in the child grid before it can save.
How can i validate this on client side before sending request to server?

So far i got this reply from my support ticket but it didn't work because at grid saveChanges event, e.container = null.
How do i get the detailrow on grid saveChanges event?

function onsaveChanges(e) {
    var detailRow = e.container.next(".k-detail-row");
    if (detailRow.length) {
        var grid = detailRow.find("[data-role='grid']").data("kendoGrid");
        var data = grid.dataSource.data();
        if (data.length === 0) {
            e.preventDefault();
            alert("error message");
        }
    }
}


Thanks in advance.
Csa
Top achievements
Rank 1
 answered on 03 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?