Telerik Forums
UI for ASP.NET MVC Forum
6 answers
440 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
487 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
132 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.7K+ 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
177 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
335 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
5 answers
487 views





Hi,



Great day.



Just would like to seek help in adding confirmation dialog to my upload
window. I added confirm dialog on select event but I did not know to
implement it properly. All I want is when the user select yes, the
upload event proceed but if the user select "No", the the confirm dialog
will close and the main kendow will close also..



Here's my code:







    $(document).ready(function () {



        var lookup = $("#ComboLookupTable").data("kendoComboBox");

        $("#get").click(function () {

        });



        $("#files").kendoUpload({

            async: {

                saveUrl: "UploadFile/Lookup",

                autoUpload: false,

                value: 'Import'

            },

            multiple: false,

            progress: function (e) {



            },

           

            select: function (e) {

                debugger;

                var kendoWindow2 = $("<div />").kendoWindow({

                    title: "Replace Lookup Table Data?",

                    resizable: false,

                    modal: true

                });



                kendoWindow2.data("kendoWindow")

                    .content($("#delete-confirmation").html())

                    .center().open();



                kendoWindow2

                    .find(".delete-confirm,.delete-cancel")

                        .click(function () {

                            if ($(this).hasClass("delete-cancel")) {

                                debugger;

                                //e.preventDefault();

                                e.close();

                                kendoWindow2.data("kendoWindow").close();

                                //return;

                            }

                            else {

                                debugger;

                                kendoWindow2.data("kendoWindow").close();

                            }

                        })

                       // .end()

            },

            localization: {

                select: "Select a file",

                uploadSelectedFiles: "Import",

                remove: "Remove"

            },

            upload: function (e) {

                debugger;



                e.data = { additional: $("#ComboLookupTable").val() };

                debugger;

            }

            //upload: onUpload

            //select: onSelect



        });

    });









<script id="delete-confirmation" type="text/x-kendo-template">

    <p class="delete-message">This will replace all of the existing data for lookup table</p>

    <p></p>

    <p> Are you sure?</p>



    <button class="delete-confirm k-button">Yes</button>

    <button class="delete-cancel k-button">No</button>

</script>







I hope you could help me on this. Thank you in advance. God bless
Dimiter Madjarov
Telerik team
 answered on 02 Jun 2014
5 answers
537 views
Hello,

I want to make specifics operations if I click on an element of the MultiSelect and others operations if I click on empty space of the MultiSelect.

How can I do this?

Best regards

Chavigny
Dimiter Madjarov
Telerik team
 answered on 02 Jun 2014
2 answers
134 views
Hello,

I want to make specifics operations if I click on an element of the MultiSelect and others operations if I click on empty space of the MultiSelect.

How can I do this?

Best regards

Chavigny
Dimiter Madjarov
Telerik team
 answered on 02 Jun 2014
2 answers
387 views
Hi,

I have a rather large form which is spread over a series of tabs to break it down into sections. I have a single "Save" button that uses ajax to post the form. This all works fine, and the validator shows errors next to the controls that fail validation. The issue i have is that if i try and save something on one tab it isn't immediately clear which tab might be showing a control that fails validation, and therefore isn't clear to the user why the form hasn't submitted.

What i'd like to do is use the validationsummary or a simple div to display the errors above the tabs in a list form. I've been experimenting with the KendoValidator and can see the list or errors under validator._errors. but is it possible to access the _errors values to append to a div using a foreach on validator_errors?

Thanks

Ant
Ant
Top achievements
Rank 1
 answered on 02 Jun 2014
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
DropDownButton
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?