Telerik Forums
Kendo UI for jQuery Forum
1 answer
236 views
I'm not sure if I'm posting in the right place....

We're using KendoUI MVC with the help wrappers.

I have a simple page created in MVC using KendoUI.

The controller sets the value of a global variable "SomeValue" on initialization, but what I don't understand is when I use AJAX binding to bind data from the controller to the grid, why when "GetData()" is called it is unable to see the value of "SomeValue" or even the value of ViewBag.Heading.

When GetData() is called its almost as if the function is being called in isolation and doesn't know anything about the anything else in the controller....

What I wanted to do was when the Index controller is called, load all my data from my database into a global variable, so when "GetData()" is called it doesn't have to reload the data from the database, it can use the data that is set to the variable "SomeValue"....

How do you do this in KendoUI?

Here is a snippet of code of what I'm trying to do....


Controller
--------------
public string SomeValue;

public ActionResult Index(string strClient, string strProductType, string strCloseOfBusinessDate)
{
    ViewBag.Heading = "DV01";

    SomeValue = "Hello there!";

    return View();
}

public ActionResult GetData(string strClientName, string strDate)
{
    return Json(Graph.GraphData(SomeValue, strClientName, strDate));
}

Petur Subev
Telerik team
 answered on 01 Oct 2013
10 answers
2.1K+ views
Hi,

I have a Telerik MVC Combobox which I'm trying to migrate it to Kendo. The original code looked like :

@(Html.Telerik().ComboBox().Name("CbPlants")
    .BindTo(new SelectList(Model.PowerPlants, "Key", "Value", Model.SelectedPowerPlant))
    .Filterable(filter => filter.FilterMode(AutoCompleteFilterMode.Contains))
    .ClientEvents(c => c.OnChange("OnCbPlantsChange"))
    .AutoFill(true))
         
After migration as per the instructions, it looks like :
           
@(Html.Kendo().ComboBox().Name("CbPlants")
       .BindTo(new SelectList(Model.PowerPlants, "Key", "Value", Model.SelectedPowerPlant))
      .DataTextField("Text")
      .DataValueField("Value")
      .Filter(FilterType.Contains)
      .Events(c => c.Change("OnCbPlantsChange"))
      .Suggest(true))


The combobox is bound to a list of powerplants, whose key is a guid. I pass both the list as well as the selected item in the binding.              
It works well except for the fact that, when the page is refreshed, I see the selected item's guid for sometime, before the correct value is displayed. Please have a look at the attached pic.

Maybe it's because of the time taken for the combobox to load. Can I suppress displaying the key till the list loads ?

I tried setting the selected item in the DataBound event, instead of the razor. That seems to work. But unfortunately, the filtering & auto fill feature doesn't then. Is there any other way to achieve what I could do with the old MVC extensions ?

Regards

Achilles
Achilles
Top achievements
Rank 1
 answered on 01 Oct 2013
1 answer
83 views
$("#stock-chart").kendoStockChart({
                   dataSource: {
                       data: incomeData
                   },
                   title: {
                       text: showName
                   },
                   dateField: "Date",
                   seriesDefaults: {
                       type: "area",
                   },
                   series:
                   [{
                       field: "Open",
                       name: "1",
 
                       color:"blue"
                   }, {
                       field: "High",
                       name: "2",
 
                       color: "green"
                   }, {
                       field: "Low",
                       name: "3",
 
                       color: "black"
                   }],
                   navigator: {
                       series: {
                           type: "area",
                           field: "Open"
                       }
                   },
                   legend: {
                       position: "bottom",
                       visible: true,
                   },
               });
           }
           $(document).ready(createChart);
           $(document).bind("kendo:skinChange", createChart);

Code works perfectly. The problem is that everytime when i hover over legend it appears in firebug that n is null. I specify that i don't have any problem with the script just it appears in firebug that n is null. My question is why? I have a problem or is from the Kendo Ui? Please if you can help it would be great.

P.S Sorry for my English is not my main language.
 
T. Tsonev
Telerik team
 answered on 01 Oct 2013
1 answer
139 views
Hi,
just I want to ask why we don't have pivot control for MVC, like the one for ajax?
and do we expect to find it in a new update ?

Thanks
Sebastian
Telerik team
 answered on 01 Oct 2013
1 answer
158 views
Hello,

We are upgrading the Kendo  version to be latest version and in this process I need to know what Jquery UI librarty version should I be using
NEW Update :I am using the new Kendo -- 2013.2.918,jquery-1.9.1.js ( this comes along with the kendo update), jquery-ui-?

Previous --jquery-ui-1.8.11.min.js, jquery-1.7.2.min, Kendo 2012.2.913

 

 

 

 

 

Sebastian
Telerik team
 answered on 01 Oct 2013
12 answers
5.1K+ views
I have a template that looks somewhat like this:

<script type="text/x-kendo-tmpl" id="thisTemplate"><div id="${data1}">
<div id="thisDiv" class="thisClass ${newClass}">
 ... Div content...
</div>
</script>

As I read in my data I would like to have ${newClass} be a string that is determined by a function:
 i.e.
if(condition A) {
${newClass} = "a string of text";
} else {
${newClass} = "a different string of text";
}

In essence, I want ${newClass} to be a string that is determined by a function.

Does anyone know how to do this...?
Atanas Korchev
Telerik team
 answered on 01 Oct 2013
5 answers
335 views
Hi,

I'm trying to implement the date filter that you have on the music store:
http://docs.kendoui.com/tutorials/ASP.NET/Kendo%20Music%20Store/Music%20Store%20Web/kendo-music-store-web-management-charts

i.e.
When a user selects 'Day', it only bring in data for a day, 'Week' only brings back information for the week .etc...
But I also want to enter a custom Start Date and End Date....

The problem is that for our implementation we had decided to go the MVC route and I cannot find any information on how to do this via your MVC toolset.

My chart looks like:

@(Html.Kendo().Chart<KendoWithChart.Models.RatioTimeSeries>()
    .Name("chartActualHedgeRatioTimeSeries")
    .Title("Actual Hedge Ratio")
    .Legend(legend => legend
        .Position(ChartLegendPosition.Bottom)
    )
    .ChartArea(chartArea => chartArea
        .Background("transparent")
    )
    .DataSource(ds => ds.Read(read => read.Action("GetRatioTimeSeriesData", "Home", new { ddlClient = @ViewBag.ClientName, dpkDate = @ViewBag.Date })))
    .Series(series =>
    {
        series.Area(model => model.Value1, model => model.Date).Name("Nuclear");
        series.Area(model => model.Value2, model => model.Date).Name("Hydro");
        series.Area(model => model.Value3, model => model.Date).Name("Wind");
    })
    .CategoryAxis(axis => axis
        .Date()
        .BaseUnit(ChartAxisBaseUnit.Days)
    )
    .ValueAxis(axis => axis.Numeric()
               .Labels(labels => labels.Format("{0:N0}"))
    )
    .Tooltip(tooltip => tooltip
        .Visible(true)
        .Format("{0:N0}")
    )
)

And it uses the controller from the demos.

What do I need to do to wire in the date filter? I want it to be seamless and to avoid any postbacks....

T. Tsonev
Telerik team
 answered on 01 Oct 2013
5 answers
421 views
Hello,

I'm using the Datasource with serverPaging where the Datasource is used by a Grid with virtual scrolling.
This works perfect except for 1 problem I'm running into.

After a cancelchanges on the Datasource the grid jumps back showing the data of the 1st Page.
When I use Datasource.get(myID), where the Model with myID is on another Page the method returns undefined.

I noticed that internally the Datasource is using an array of ranges, where 1 range contains the models of 1 page, but I don't think a Datasource.get(myID) is using those ranges.

For now i'm using a descendant of the Datasource where I implemented a findByID to use the _ranges as well.
Alexander Valchev
Telerik team
 answered on 01 Oct 2013
3 answers
233 views
Hi all;
The screenshot here is from out Windows desktop app. Is it possible to do the same thing in Kendo?
The user needs to be able to type in the value for a comparison. They also need to be able to select from the tree. And the tree needs to populate nodes when they are expanded because the tree can have nodes that are circular (ie Salesperson -> Orders -> Order -> Salesperson).
How can I do this?
thanks - dave
Dimiter Madjarov
Telerik team
 answered on 01 Oct 2013
1 answer
69 views
The + button appears half way across the grid rather than indented on the left.  This is due to an ie10 bug that they claim is not a bug, and have no plans to fix.  More here:

https://connect.microsoft.com/IE/feedback/details/781009/ie-10-fails-to-render-tables-width-fixed-layout-correctly

Please let me know if you have plans to resolve this issue.

Thanks,
Mark Hynes
Dimiter Madjarov
Telerik team
 answered on 01 Oct 2013
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
Drag and Drop
Application
Map
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
Licensing
ScrollView
Switch
TextArea
BulletChart
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
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
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
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?