Telerik Forums
Kendo UI for jQuery Forum
2 answers
893 views
I have a problem that when we datasource.read() it gets cached data and not up-to-date data from the server.
Of course it seems that it only does it in internet explorer... firefox works fine.

We send a query string with a random number to keep the request from getting cached data.
GridData = new kendo.data.DataSource({
     transport: {
            read: {
                url: buildAsyncUrl('GetData'),
                dataType: "json",
                data: JSON.stringify(GridFilters)
            }
        },
        ......
});

function buildAsyncUrl(cont) {
    return cont + '/?nocache=' + Math.random();
}

//whenever we need to refresh the grid we call:
 
GridData.read();


If you profile it it firefox:
1rst request:   ?nocache=0.36012812319771115
2nd request:   ?nocache=0.5465367197402407
3rd request:   ?nocache=0.5722005265817256

If you profile it in IE:
1rst request:   ?nocache=0.6602959470869887
2nd request:   ?nocache=0.6602959470869887
3rd request:   ?nocache=0.6602959470869887

How can I keep the datasource.read() from reusing the same value (url) it had when first called or initiated??
Or is there any "no cache" like option?
Traci
Top achievements
Rank 1
 answered on 19 Sep 2012
6 answers
365 views
Team,
     I'm looking for a way to override the parameter names passed to the service when calling read or even just overriding the read to be able to modify the url to change it to my liking.  I would like to override the parameter so that instead of passing things like take=20 for page size, it would pass $take=20...  Thanks!
poet_byron
Top achievements
Rank 1
 answered on 19 Sep 2012
2 answers
279 views
which is the best way to rebind data for charts



from js and asp.net mvc extensions.



Documentation is not as deep as the older controls
Spartan IV
Top achievements
Rank 1
 answered on 19 Sep 2012
1 answer
92 views
Hi,
I have a grid with connected to remote data-source which bound to 7 fields
I want to display only  5  columns when grid loads
But when i want to edit form pops i want to show the 7 columns

How can i config columns in grid that control what to be seen in grid and what to be seen in edit form

http://docs.kendoui.com/api/web/grid

Your feedback is appreciated



Best Regards
Wael

Iliana Dyankova
Telerik team
 answered on 19 Sep 2012
3 answers
498 views
Hey Guys,

First, I want to say you guys did a great Job on Kendo UI, we are planing to upgrade from MVC extension to Kendo.
My issue is on the grouped line chart the legend is taking the default sort of the group data and showing as the attached image.
Is there a way to control the order on the legend?

<%= Html.Kendo().Chart<TestOrders>()
        .Name("Hl7Line")
        .Title("Number of NEW ORDERS PER HOUR BY MONTH  -  RUNNING TOTAL")
        .ChartArea(chartArea => chartArea.Background("transparent"))
        .Legend(legend => legend.Position(Kendo.Mvc.UI.ChartLegendPosition.Right))
        .DataSource(ds => ds
            .Read(read => read.Action("AJaxOrdersPerHourByMonth", "Dashboard"))
            .Group(group => group.Add(m => m.MonthName))
            .Sort(sort => sort.Add(m => m.Hour).Ascending())
        )
        .Series(series => series
            .Line(model => model.NumberOfOrders)
            .GroupNameTemplate("#= group.value #")
        )
        .CategoryAxis(axis => axis
            .Categories("12AM", "1AM", "2AM", "3AM", "4AM", "5AM", "6AM", "7AM", "8AM", "9AM", "10AM", "11AM", "12PM", "1PM", "2PM", "3PM", "4PM", "5PM", "6PM", "7PM", "8PM", "9PM", "10PM", "11PM")
            .Title("Hours of Day")
        )
        .ValueAxis(axis => axis
            .Numeric().Labels(labels => labels.Format("{0}"))
            .Title("Number of Orders")
        )
        .Tooltip(t => t.Visible(true).Format("{0}").Template("#=series.name# (#= value#)"))
        .Transitions(true)
    %>
Nate
Top achievements
Rank 1
 answered on 19 Sep 2012
1 answer
295 views
Hi, I have a following scenario:

- for each day in month, I need calendar to indicate if a task is done or not done for that day
- I could use icons as a markers like in 'Customizing Templates' example, but calendar might look too cluttered
- I'd prefer to set date cell background color to green or red to indicate if task is done or not.

I did check the documentation, but couldn't find any direct way to do it. The template for dates in month view looks promising, but I don't have enough knowledge of that. So, could you help me with this problem? Is there a feasible way to change date cell background color, or should I use some alternative way?


OnaBai
Top achievements
Rank 2
 answered on 19 Sep 2012
0 answers
168 views
I have a Kendo Chart defined on my cshtml page as below:

@(Html.Kendo().Chart<MyModel>()
        .Name("chart")
        .Title("")
        .Legend(legend => legend
            .Visible(false)
        )
        .Series(series =>
         {
                    series.Scatter(model => model.X, model => model.Y);
                    series.Scatter(model => model.X, model => model.Y);
        })
        )
        
I need to set the data of each of these series using a JQuery call. 


 function GetChartData(ex,ten) {
            var str = "{'arg': '" + ex + "', 'arg2': '" + ten ' }";
            $.ajax({
                type: 'POST',
                url: '/Controller/CreateChartData',
                dataType: "json",
                contentType: "application/json; charset=utf-8",
                data: str ,
                success: function (data) {
                
                    var grid = $("#chart").data("kendoChart");
                    grid.dataSource.data(data.ChartData);
                    grid.refresh();
                    
                },
                error: function (xhr, ajaxOptions, thrownError) {
                    alert(xhr.status);
                    alert(thrownError);
                }
            });

The above will set the 1st series data, but I need to be able to set the second series as well. I have all of the data returning correctly from the database, but no way of setting both series data.

I have tried the following which rendered nothing on the chart:

 function GetChartData(ex,ten) {
            var str = "{'arg': '" + ex + "', 'arg2': '" + ten ' }";
            $.ajax({
                type: 'POST',
                url: '/Controller/CreateChartData',
                dataType: "json",
                contentType: "application/json; charset=utf-8",
                data: str ,
                success: function (data) {
                
                    var grid = $("#chart").data("kendoChart");
    grid.options.series[0].data = data.ChartData;
     grid.options.series[1].data = data.ChartDataSeries2; 

                    grid.refresh();
                    
                },
                error: function (xhr, ajaxOptions, thrownError) {
                    alert(xhr.status);
                    alert(thrownError);
                }
            });

 
                  
Ben
Top achievements
Rank 1
 asked on 19 Sep 2012
1 answer
131 views
I do not know if this is possible, or if this can be added to a new version of the DataViz toolkit.

I would like to be able to add an image, or icon inside a Bubble Chart so you know exactly what it is with just looking at it

Thanks
Iliana Dyankova
Telerik team
 answered on 19 Sep 2012
0 answers
105 views
How to add 'Menu' next to title of 'Window' Component or on hover of custiom icon how to populate a menu with 4 items

Thanks,
Chetan
Chetan
Top achievements
Rank 1
 asked on 19 Sep 2012
1 answer
889 views
The following code is dataSource for validating values via a controller method:

            SampleDataSource: new kendo.data.DataSource({
                transport: {
                    read: {
                        url:  "Sample/ValidateSampleCodes",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        type: "POST"
                    },
                    parameterMap: function (options, operation) {
                        return JSON.stringify({ SampleCode: options.SampleCode });
                    },
                },
                schema: {
                    model: {
                        id: "Id"
                    },
                    parse: function (data) {
                        viewModel.set("SampleCodesFromDB",data[0]);
                        return data;
                    }
                }
            }),

The following code is the grid in which i need to validate values entered, instantly and display an in-line validation message. I am using the custom validator as shown below...

                $("#Sample-code-grid").kendoGrid({
                    dataSource: { 
                        data: viewModel.SampleCodes,
                        schema: {
                            model: {
                                id:"Id",
                                fields : {
                                    SampleCode : { editable: true, validation: { custom: function (input) {
                                            var isValid = true;
                                            if (input.attr("name") == "SampleCode") {
                                                
                                                // Reading the below datasource to check if value already exists in DB
                                                
                                                viewModel.SampleDataSource.read({ SampleCode: input.val() });


                                                // When debugging, i find that the above read method call is skipped until 
                                                // custom validator function is fully executed...


                                                var isValidMessage = viewModel.get("SampleCodesFromDB");
                                                if(isValidMessage == "Code Exists")
                                                    isValid = false;
                                                if(!isValid)
                                                    input.attr("data-custom-msg", "Sample Code already added.");
                                            }
                                            return isValid;
                                        }
                                        }
                                    }
                                }
                            }
                        },
                        change: function(e) {
                            if(e.action == "itemchange" || "remove") {debugger;
                                viewModel.SampleCodes = [];
                                $.each(e.sender.data(), function(inx, val) {
                                    viewModel.SampleCodes.push({ SampleCode : val.SampleCode });
                                });
                            }
                        }
                    },
                    selectable: true,
                    editable: "inline",
                    toolbar: [{ name: "create" , text : "Add Sample Code" }],
                    columns: [
                        { field: "SampleCode", title: "Sample Codes" },
                        { command: ["edit", "destroy"], title: "&nbsp;", width: "210px" }
                    ]
                });

I have added some comments inside the code so that you get some idea about my problem. I just need to know how to approach validation for duplicates using the custom validator that calls a dataSource for the same purpose.

Any help will be greatly appreciated.
Alex
Top achievements
Rank 1
 answered on 19 Sep 2012
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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
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
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?