Telerik Forums
Kendo UI for jQuery Forum
1 answer
235 views
Dear Expert,

i was trying to populate dates from my server into Kendo UI Calendar. when i navigate to previous year, i would like to recreate\rebind the calendar with new dates.
I having issue where when i tried to rebind my calendar, it will hang.
Below are my code:


//on PageLoad,
01.$.ajax({
02.         url: "/test/GetTimelogJson",
03.         dataType: "json",
04.        type: 'GET'
05.     })
06.     .fail(function () {
07.        alert("fail");
08.    })
09.    .success(function (data) {
10.        $.map(data, function (value, key) {
11.                var d = +new Date(key);
12.                timelogDay[d] = value;
13.        });
14.        $("#calTimelog").kendoCalendar({
15.            value: Date.Today,
16.          dates: timelogDay,
17.          navigate: onNavigate,
18.            month: {
19.                content: '# if (typeof data.dates[+data.date] === "string") { #' +
20.                        '<div class="#= data.dates[+data.date] #">' +
21.                        '#= data.value #' +
22.                        '</div>' +
23.                        '# } else { #' +
24.                        '#= data.value #' +
25.                        '# } #'
26.            },
27.       });
28.    });


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
When user click on navigate, i will call the onNavigate function:

 
01.function onNavigate() {
02.    try
03.    {
04.         var todayDate = new Date();
05.         //Compare date if it not equal to 2014,
06.          if (this.current().getFullYear() != todayDate.getFullYear())
07.           
08.               todayDate = this.current(); //set the todayDate to selected View
09.               reCreateCalendar(this.current());
10.            }
11.      }
12.        catch (err) {
13.         alert(err);
14.        }
15.     }

//recreate the calendar
   
01.function reCreateCalendar(compareDate) {
02.        $('#calTimelog').data('kendoCalendar').destroy();
03.        $('#calTimelog').empty();
04. 
05.        var date1 = new Date(2013, compareDate.getMonth(), 1),
06.                     birthdays = [
07.                        +new Date(2013,12, 3),
08.                        +new Date(2013,12, 5),
09.                        +new Date(2013,12, 22),
10.                        +new Date(2013, 12, 27)
11.                     ];
12.    
13.        $("#calTimelog").kendoCalendar({
14.            value: date1,
15.            dates: birthdays, navigate: onNavigate,
16.            month: {
17.                content: '# if (typeof data.dates[+data.date] === "string") { #' +
18.                        '<div class="#= data.dates[+data.date] #">' +
19.                        '#= data.value #' +
20.                        '</div>' +
21.                        '# } else { #' +
22.                        '#= data.value #' +
23.                        '# } #'
24.            },
25. 
26.        });
27.}
28.    }

Any Idea how to get the calendar working? thank you.

Regards,

CH
Top achievements
Rank 1
 answered on 30 Jun 2014
3 answers
345 views
Hi:
The following uses a jQuery selector to kick kendo off.  Can I get the value of that selector, so that I may do jQuery stuff with it.
<div id ="listView2"></div>
<script>
    $("#listView2").kendoListView({
        dataSource: { data: [ { name: "Jane Doe" }, { name: "John Doe" }] },
        template: "<div>#:name#</div>"
    });
</script>

Phil
Phil H.
Top achievements
Rank 2
 answered on 29 Jun 2014
7 answers
484 views
Hello,

I have a grid defined like so:

var dataSource = new kendo.data.DataSource({
       data: tableRows
});
var gridOptions = {
      columns: tableColumns,
      dataSource: dataSource,
      editable: true
}

$("#grid").kendoGrid(gridOptions);

Then I have my own button in my html which is used to add a new row to the grid:

dataSource.add({ field1: "value", field2: "value" });

When I click on a cell to edit its value, the little red triangle indicating the cell is dirty appears. All data is local so I want all editing to be immediately propagated to the data of the data source, and therefore I do not want this red triangle to appear.

What's the best way to achieve this?

Thanks,
Marc.
Alexander Valchev
Telerik team
 answered on 27 Jun 2014
2 answers
576 views
Hi,

I'm trying to persist the current PageSize in a grid.  To do so, I have a cookie with the previous session's PageSize in it.  On the DataBound event for the grid, I fire the following routine (uses jquery.cookie.js):

function onDataBoundBilling(e) {
    // Get cookie (if any).
    var cookiePageSize = JSON.parse($.cookie("billingPageSize"));
 
    // Push new value to PageSize.
    if ($.cookie('billingPageSize')) {
        var grid = $("#billingGrid").data("kendoGrid");
        grid.dataSource.pageSize(parseInt(cookiePageSize));
    }
}

This correctly resizes the grid to the value in the cookie.  However, the grid pager's drop down list still shows the original PageSize value.  How can I cause this to update?
wgmleslie
Top achievements
Rank 1
 answered on 27 Jun 2014
1 answer
93 views
Hi,

I need to send each rows of my grid to my C# controller.
In my js code, i use this way : 

        $("#myButton").click(function () {
            debugger;
            var applicationSectionId = $("#myComboBoxSections").data("kendoComboBox").value();
            var providerName = $("#myTbName").val();
            var typeProvider = $("#myComboBoxTypes").data("kendoComboBox").value();
            var sensTraitement = $("#myComboBoxSens").data("kendoComboBox").value();
            var parameters = $('#myGid').data('kendoGrid')._data;
            $.post(_pathRoot + "AddNewProvider",
                {
                    applicationSectionId: applicationSectionId,
                    providerName: providerName,
                    typeProvider: typeProvider,
                    sensTraitement: sensTraitement,
                    parameters : parameters 
                })
            .done(function (result) {
                debugger;
            });

Here is m model in the grid :
                    model: {
                        fields: {
                            Nom: { type: "string" },
                            Valeur: { type: "string" }
                        }
                    }

My controller method, in the .cs file is like this:
public async Task<JsonResult> AddNewProvider(int? applicationSectionId, string providerName, string typeProvider, string sensTraitement, object parameters )

Each time, all data are effectively sent, except "parameters" which is {string[1]} in VS 2012 debugger, and is finally empty.
Wich class should i use tu get rows in my controller ?

Thanks in advance.

Petur Subev
Telerik team
 answered on 27 Jun 2014
1 answer
73 views
 File upload already in the directory but my status is Error Can anybody help me, thanks in advance..

 Here's my sample Code

/////////// kendo_upload.aspx /////////////////////////////////////////////////////////////

         $("#uploaded").kendoUpload({

                async: {
                    saveUrl:"kendo_upload.aspx",
                    removeUrl:"remove",
                    autoUpload: true
                },
                onSuccess: onSuccess,
                error: onError

            });

/////////////// kendo_upload.aspx.cs /////////////////////////////////////////////////////////////////////////////

protected void Page_Load(object sender, EventArgs e)
        {
            ProcessRequest();

        }

        public void ProcessRequest()
        {

            Response.Expires = 1;
            try
            {
                HttpPostedFile file = Request.Files["uploaded"];

                if (file != null)
                {

                    string savepath = Server.MapPath("~/UploadFiles/");
                    string filename = file.FileName;
                    file.SaveAs(savepath + filename);
                    Response.ContentType = "application/json";
                    Context.Response.Write("{}");

                }


            }

            catch (Exception ex)
            {
                Response.Write(ex.ToString());
            }
        
        }







Petur Subev
Telerik team
 answered on 27 Jun 2014
5 answers
800 views
I would like to change colors in my slider.

I found that i could change the color of the selected area thanks to css class k-slider-selection
.k-slider-selection {
           background-color: #059BD8;
  }


Now i would like to do same for the "ball" shape selector  and the not selected area.

Could you help me please?
stephane
Top achievements
Rank 1
 answered on 27 Jun 2014
1 answer
94 views
In my chart I'm want to render lines and columns bars and want to dynamically set the values of these however no data is rendered even though its been received. I'm using Razor, MVC and my view looks like:

01.@(Html.Kendo().Chart<HourBandChartModel>()
02.    .Name("chartWeeklyHours")
03.    .Title("Weekly Hours vs GCs")
04.    .DataSource(d =>
05.d.Read(r => r.Action("WeeklyHoursVsGuestCheck","ForecastSummaryGraph", new { hutnumber = @ViewBag.HutNumber, week = @ViewBag.Week })))
06.    .Legend(
07.      legend => legend.Position(ChartLegendPosition.Top)
08.    )
09.    .ChartArea(
10.      chart => chart.Width(900).Height(500))
11.    .Series(series =>
12.        {
13.            series
14.                .Column(c => c.TotalHours)
15.                .Stack(true)
16.                .Color("#FFAE00")
17.                .Name("FCST Hours");
18.            series
19.                .Line(c => c.GuestChecks)
20.                .Name("GCs")
21.                .Color("#000000")
22.                .Axis("GCs");
23.        })
24.    .CategoryAxis(axis => axis.Categories(c => c.HourBand)
32.                              .AxisCrossingValue(0, 24)
33.                              .Labels(builder => builder .Rotation(90))
34.    )
35.    .ValueAxis(axis => axis
36.                           .Numeric()
37.                           .Title("hours")
38.                           .Min(0).Max(60)
39.    )
40.    .ValueAxis(axis => axis
41.                           .Numeric("GCs")
42.                           .Title("GCs")
43.                           .Color("#000000")
44.                           .Min(0).Max(120)
45.    ))

As you can see in bold I'm trying to set the Column, Line and Category series with the property values from my model TotalHours, GuestChecks and HourBand respectively. The read call works and Json data is returned in the form below however the chart is empty:
 
1.{"HourBand":["08:30 TO 08:44","08:45 TO 08:59","09:00 TO 09:14","09:15 TO 09:29","09:30 TO 09:44","09:45 TO 09:59","10:00 TO 10:14","10:15 TO 10:29","10:30 TO 10:44","10:45 TO 10:59","11:00 TO 11:14","11:15 TO 11:29","11:30 TO 11:44","11:45 TO 11:59","12:00 TO 12:14","12:15 TO 12:29","12:30 TO 12:44","12:45 TO 12:59","13:00 TO 13:14","13:15 TO 13:29","13:30 TO 13:44","13:45 TO 13:59","14:00 TO 14:14","14:15 TO 14:29","14:30 TO 14:44","14:45 TO 14:59","15:00 TO 15:14","15:15 TO 15:29","15:30 TO 15:44","15:45 TO 15:59","16:00 TO 16:14","16:15 TO 16:29","16:30 TO 16:44","16:45 TO 16:59","17:00 TO 17:14","17:15 TO 17:29","17:30 TO 17:44","17:45 TO 17:59","18:00 TO 18:14","18:15 TO 18:29","18:30 TO 18:44","18:45 TO 18:59","19:00 TO 19:14","19:15 TO 19:29","19:30 TO 19:44","19:45 TO 19:59","20:00 TO 20:14","20:15 TO 20:29","20:30 TO 20:44","20:45 TO 20:59","21:00 TO 21:14","21:15 TO 21:29","21:30 TO 21:44","21:45 TO 21:59","22:00 TO 22:14","22:15 TO 22:29","22:30 TO 22:44","22:45 TO 22:59","23:00 TO 23:14","23:15 TO 23:29","23:30 TO 23:44","23:45 TO 23:59","08:00 TO 08:14","08:15 TO 08:29","00:00 TO 00:14","00:15 TO 00:29","00:30 TO 00:44","00:45 TO 00:59","01:00 TO 01:14","01:15 TO 01:29","01:30 TO 01:44","01:45 TO 01:59","02:00 TO 02:14","02:15 TO 02:29","02:30 TO 02:44","02:45 TO 02:59","03:00 TO 03:14","03:15 TO 03:29","03:30 TO 03:44","03:45 TO 03:59"],"GuestChecks":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.6870950136819702037093341442,5.4323052923971649283961570087,6.2562318952223273304930234815,8.302215778605969758695686634,11.986234206953644671253542133,15.133949330695317203420495954,10.933766737622301835390467521,15.922897377012719269275953013,14.327781343367204133067517661,9.645984320466688510349290632,12.429324848980508265476515872,9.845401284984459973332645456,10.641676202376483817987287683,8.925776082018158342296234009,11.024874872660178686169961838,10.369633291640308255593647797,9.796089572670810793898682470,12.065731902127977027517901032,15.306830620455298549977650831,12.680103474911442768763927566,11.890744376448765792980064392,15.541874733822365043792078810,22.635034805972250926443991782,20.078212524026518428252445470,25.769456639790301763168163418,26.568228435189089645620353290,31.422432578176282726455964472,34.961916031422341072867055287,35.351623416190162610425511464,42.618806500469603977793045234,45.754127724007935398948886367,50.766125123078935124979965920,47.395183195739208008443456131,51.093378012588750673569195519,45.943773042578171380959348957,44.394986572567142869467708363,40.967684125553898103876121554,34.644890908164853051332970573,34.032537220376213973745049750,30.012515326554615658578259615,25.151990821775101801652908783,19.165127263440938757842228920,14.144022089319294761630903445,16.878605044235780505127701259,17.304076264218793737861259611,9.120920924679328592035034514,8.303104190382729195458045860,3.5046744557889760486326145604,2.3986441983253042488035707965,1.3403272558838929688653786770,0.6810727503815188253247944721,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"TotalHours":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.6870950136819702037093341442,5.4323052923971649283961570087,6.2562318952223273304930234815,8.302215778605969758695686634,11.986234206953644671253542133,15.133949330695317203420495954,10.933766737622301835390467521,15.922897377012719269275953013,14.327781343367204133067517661,9.645984320466688510349290632,12.429324848980508265476515872,9.845401284984459973332645456,10.641676202376483817987287683,8.925776082018158342296234009,11.024874872660178686169961838,10.369633291640308255593647797,9.796089572670810793898682470,12.065731902127977027517901032,15.306830620455298549977650831,12.680103474911442768763927566,11.890744376448765792980064392,15.541874733822365043792078810,22.635034805972250926443991782,20.078212524026518428252445470,25.769456639790301763168163418,26.568228435189089645620353290,31.422432578176282726455964472,34.961916031422341072867055287,35.351623416190162610425511464,42.618806500469603977793045234,45.754127724007935398948886367,50.766125123078935124979965920,47.395183195739208008443456131,51.093378012588750673569195519,45.943773042578171380959348957,44.394986572567142869467708363,40.967684125553898103876121554,34.644890908164853051332970573,34.032537220376213973745049750,30.012515326554615658578259615,25.151990821775101801652908783,19.165127263440938757842228920,14.144022089319294761630903445,16.878605044235780505127701259,17.304076264218793737861259611,9.120920924679328592035034514,8.303104190382729195458045860,3.5046744557889760486326145604,2.3986441983253042488035707965,1.3403272558838929688653786770,0.6810727503815188253247944721,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"FixedHours":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]}

The model looks like:
01.public class HourBandChartModel
02.{
03.    public IEnumerable<string> HourBand
04.    {
05.        get; set;
06.    }
07. 
08.    public IEnumerable<decimal> GuestChecks
09.    {
10.        get;
11.        set;
12.    }
13. 
14.    public IEnumerable<decimal> TotalHours
15.    {
16.        get;
17.        set;
18.    }
19. 
20.    public IEnumerable<decimal> FixedHours
21.    {
22.        get;
23.        set;
24.    }
25.}
Please help. Driving me crazy!
Hristo Germanov
Telerik team
 answered on 27 Jun 2014
3 answers
211 views
I am building a Kendo UI application which is working perfectly fine in IE11. But when I add the site to be displayed in compatibility mode in IE11 i am getting an error "'NodeFilter' is undefined'. It raises this error while rendering the layout. see below code.var appRouter = new kendo.Router({
init: function () {
layout.render("#application");
}
});Error is raised in kendo.web.min.js where it tries to remove white spaces (I guess by the name). This is the line of code that is failing.var t=document.createNodeIterator(n,NodeFilter.SHOW_TEXT,function(t){...}

Just learned that NodeFilter is a property for window object. window.NodeFilter is null when compatibility mode is enabled in IE11. But Telerik demo SPA site works fine under these settings.

I have posted this question here also http://stackoverflow.com/questions/24372876/nodefilter-is-undefined-error-when-using-ie-compatibility-mode-with-kendo-ui-spa
Petyo
Telerik team
 answered on 27 Jun 2014
6 answers
247 views
Using kendo ui web.

Picture the following scenario - The 3 simplified tables below are linked via keys:

InspectionTable
-InpsectionId
-RouteScheduleId
-InspectionDetail

RouteScheduleTable
-RouteScheduleId
-RouteId
-ScheduleId

RouteTable
-RouteId
-RouteNumber

ScheduleTable
-ScheduleId
-ScheduleName

In my kendo ui web Grid I want the following data:

|InspectionDetail| |RouteNumber| |ScheduleName|

Handling simple foreign keys I have no problems with. However, no doubt you can see my dilema now as the foreign keys are nested. These are the issues that pops up when I normalize tables too tight :(

Can you smooth the above scenario for me?
I will then apply it to my actual situation.
Vladimir Iliev
Telerik team
 answered on 27 Jun 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
Application
Map
Drag and Drop
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?