Telerik Forums
Kendo UI for jQuery Forum
1 answer
181 views
I am trying to figure out how to get a date column to sort when the grid was initialized from an html table. I see from the demos that I would have added formatting to the columns, but I don't see how to add the format when initializing from HTML.

Some things to take into consideration in trying to answert this question:

The size of the table, and number of columns, is created dynamically in a JSP using jstl. This means that a row might be date, and it might not be.

The formatting of the date is always "ddMMMyyyy", all upper case.

Here is an example of what the html might look like:
<tr>
    <td><div>01JAN2013</div></td>
</tr>

Notice that it has a div in it, which is used for cell scrolling, should the value not be a date, and have large amounts of text in it.

The jstl for the header of the date might be something like this:

<c:forEach var="column" items="${row}">
<c:choose>
    <c:when test="${column.type eq "date"}" >
        <th <%---Add some kind fo attribute here to tell kendo this is a date?---%>My Date</th>
     </c:when>
     <c:otherwise>
         <%-- Do some other stuff, without date formatting --%>
     </c:otherwise>
 </c:choose>
</c:forEach>

I suppose I could try to build the JavaScript object dynamically, but I really dislike the idea of building JavaScript objects with jstl, and I'm not certain how that might conflict with initializing from html.

I'm working with some legacy data and services, and so I have no choice as to how the data is returned to the JSP. 


Alexander Valchev
Telerik team
 answered on 01 Oct 2013
1 answer
195 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.0K+ 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
60 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
106 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
115 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
4.8K+ 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
284 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
366 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
167 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?