Telerik Forums
Kendo UI for jQuery Forum
1 answer
103 views
Hey guys,
I'm new to Kendo UI. This is basically my first post on forum. I'm on trial version now. I have  a few questions about customizing of column charts.

This is the database in MS SQL that I'm mapping.
[url=http://ifotos.pl/zobacz/1png_neepeqr.png/][img]http://s6.ifotos.pl/mini/1png_neepeqr.png[/img][/url]
This is my controller:
public ActionResult Index()
{
IList<CzasPracyMaszyn> CzasPracyMaszyn = _repository.GetCzasPracyMaszyn();
return View(CzasPracyMaszyn);
}
 
My model:
public class CzasPracyMaszyn
{
public virtual int ID { get; set; }
public virtual string STANOWISKO { get; set; }
public virtual int CZASPRACY { get; set; }
}

and my view:
@model IEnumerable<CMMS_Aplixcom_alfa.Models.CzasPracyMaszyn>

@(Html.Kendo().Chart(Model)
      .Name("aa")
        .Title("aaa")
      .Series(series => {
          series.Column(model => model.CZASPRACY).Name("Czas Pracy");
      })
      .CategoryAxis(axis => axis
          .Categories(model => model.STANOWISKO)
 
        )
)
This is the chart I'm getting.
[url=http://ifotos.pl/zobacz/2png_neepeqa.png/][img]http://s6.ifotos.pl/mini/2png_neepeqa.png[/img][/url]

Now I am able to turn of/ turn on Columns using the box on the right. But I would like to do that for each record in the database separately.




Iliana Dyankova
Telerik team
 answered on 12 Aug 2013
15 answers
106 views
Hello,

The loading image don't stop when endless scrolling is used: http://jsbin.com/eqisip/17/edit

I know that  something changed in the behaviour. But how can I get this smooth?
And in some cases my list has 2 items. Then I also see the loading image.

Thanks,
Martin
Petyo
Telerik team
 answered on 12 Aug 2013
1 answer
462 views
Context: MVC 4 in VS 2102 with Update 3.  Kendo Version: 2013.1.319

I'm developing a Query Wizard web-page. The Index method of the "WorkOrder" controller generates the initial page with the search Criteria (partial view) showing standard filter parameters and a Search button. The search button activates JS which then uses the parameters in the Criteria to download a QueryInfo object (using getJSON). This object represents a stored query in our database. The business layer caches this QueryInfo object in the Session cache. Then, the JS loads the Kendo Grid by loading a partial view into an empty div element (using .load()).

Here is the .cshtml for the Grid:
@model AssetPoint.TabWare.Central.Query.QueryInfo

@(Html.Kendo().Grid<System.Data.DataRowView>()
    .Name("QwGrid")
    .HtmlAttributes(new { style = "height:430px;" })
    .Pageable(pager => pager.Messages(messages => messages.Empty("No data")))
    .Sortable()
    .Scrollable()
    .Filterable()
    .Columns(columns =>
    {
        foreach (AssetPoint.TabWare.Central.Query.IQwInquiryColumn column in Model.ColumnsUsed)
        {
            var gridCol = columns.Bound(column.Name)
                .Title(column.LabelText)
                .Width(InquiryColumn.ComputeWidth(column));
            if (InquiryColumn.HasFormat(column))
                gridCol.Format(InquiryColumn.GetFormat(column));
        }
    })
    .Resizable(b => b.Columns(true))
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read
            // Set the action method which will return the data in JSON format
            .Action("GetResultsData", "WorkOrder", new { area = "QueryWizard" }) 
            // Specify the JavaScript function which will return the parameter data
            .Data("getParameters") 
        )
        .ServerOperation(true)
    )
)
As you can see, from the dataSource, we have a GetResultsData method which returns the resulting DataTable as a Json object. My plan was to the call the 'refresh()' method on the kendoGrid object's dataSource in the load success function.

My first problem was the when I accessed the 'QwGrid' element after the load, it was not a kendoGrid object, so I tried calling the kendoGrid() method on the element. This does transform the <div>  element into a kendoGrid object

Here is pertinent JS which is located in the very last element before the </body> element, in a
<script type="text/javascript"> $(document).ready(function () {}); </script> block :
function fillGrid()
{
    // get grid definition for currently selected query
    $('#QwResults').load('@Url.Action("Grid","WorkOrder", new { area = "QueryWizard" } )', 
     function (response, status, xhr)
     {
        if (status == "error")
        {
              alert("An error occurred while loading the Grid control.");
        }
        else
        {
            alert("A Grid definition was returned.");

            // bind data to grid
            var grid = $('#QwGrid').kendoGrid();
    
            if (grid != undefined)
            {
                grid.dataSource.fetch();
            }
        }
    });

    window.Parameters = {
        WorkOrder: $("#WorkOrder").val(),
        Description: $("#Description").val(),
        Equipment: $("#Equipment").val(),
        InquiryName: queryInfo.InquiryName,
        Query: queryInfo.Name,
        Criteria: {}
    };

    if (queryInfo.AskAtExecution)
    {
        //    Walk down the inputs in the window, grabbing their names
        //    and values to provide as criteria.  
        $('#window input[data-QW-field]').filter(function () {
            var x = $(this);
            window.Parameters.Criteria[x.attr("data-QW-field")] = x.val().toString();
        });
    }
}

function getParameters(data)
{
     return window.Parameters;
}
Console Errors (in Chrome):
1. Uncaught ReferenceError: getParameters is not defined
2. Uncaught TypeError: Cannot call method 'fetch' of undefined WorkOrder:261

Questions:
1. Why is the getParameters method that I am providing not found?

2. Why is the datasource undefined in the kendoGrid object?

3. Is there a better way to do this? Note: Each query has it's own set of columns and the results are delivered in a DataTable.

Thanks,
Russ
Atanas Korchev
Telerik team
 answered on 12 Aug 2013
3 answers
909 views


 

 

 
Hi, 
 Is possible to set selected values of the multiselect which are not part of the current multiselect client values:  currently, bounded data  of the multilist


When working  with datatasource  which is OData Service, not all data is brought to the client.(All the data is found on the server).  But we still need to mark the selected values of the
multilist. Part of them is not on the client currently

Thanks,

 
Atanas Korchev
Telerik team
 answered on 12 Aug 2013
1 answer
79 views
Hi,

Just wondering is it possible to load a webpage into the editor or would I have to have the webpage's html saved somewhere and load it in this way?

Alex Gyoshev
Telerik team
 answered on 12 Aug 2013
1 answer
413 views
Hello.

I have a dialog that is loaded from ajax and shown with jquery ui dialog, the html returned by ajax contains a kendo ui datepicker, this datepicker works the first time, but after closing the dialog and opening it again the datepicker is just a text input with no kendo behaviour.

I'm using the MVC helpers, the HTML returned by ajax is like this:
<form action="@Url.Action("Save", "Calendario")" method="post" data-as-ajax="edit-appointment">
       <input type="hidden" name="ID" value="@Model.ID" />
       <div class="row">
           <label for="FechaInicio">Fecha Inicio</label>
           @Html.Kendo().DatePicker().Name("FechaInicio").Value(Model.FechaInicio)
       </div>
       <div class="row">
           <label for="Asunto">Asunto</label>
           <textarea name="Asunto">@Model.Asunto</textarea>
       </div>
       <div class="row">
           <label for="Observaciones">Observaciones</label>
           <textarea name="Observaciones">@Model.Observaciones</textarea>
       </div>
       <input type="submit" value="Guardar" />
   </form>

How can I fix it so that it always works, and not only the first time?

Thanks.
Sergi
Top achievements
Rank 1
 answered on 12 Aug 2013
5 answers
189 views
Context: http://jsfiddle.net/regisbsb/2kQGs/

Hi,

I'm trying to do something very simple.
It is just a menu inside a tree. 
But kendo tree gets confused on the onSelect event of the tree. It thinks it is a menu item the e.node!
Could you fix that bug please?

Please open the fiddle and firebug on console tab to see a demo.
Alex Gyoshev
Telerik team
 answered on 12 Aug 2013
1 answer
71 views
Hello,

A client reported that the tooltips on the custom tools we have in the ediors no longer work after the new Q2 kendo version. So I checked, everything is setup as it has always been via the tooltip property. And I checked the documentation to see if anything changed. Looks the same. Then I went to your demos and saw that you have a custom toolbar and it has a tooltip but its also not showing (latest Google Chrome). I can see in your demo that even though the tooltip is setup, the elemnt has no title.

http://demos.kendoui.com/web/editor/custom-tools.html

 Is this some bug or am I just doing something wrong?

Alex Gyoshev
Telerik team
 answered on 12 Aug 2013
3 answers
229 views
Hi all,

I'm using the ASP.NET wrapper, but I figured this question is general enough it would be better posted here.

I'd like to create a cascading dropdown structure for a many-to-many data relationship. An example structure similar to my data:
Course model (id CourseID) can have many Students.
Student model (id StudentID) can have many Courses.
A third table (CourseStudent) links the two IDs, meaning that neither model has an ID reference to the other.

Is there any easy way to do this? Using the "CascadeFrom" method during definition works for one-to-many relationships, but not in this case. Do I need to include a computed property on one of my models in order to have the ID?

Thanks,
Jeff
Kiril Nikolov
Telerik team
 answered on 12 Aug 2013
1 answer
314 views
I am attempting to use the Kendo UI MVVM framework with the Kendo UI drag and drop mechanic; But I am having a very difficult time finding out how to get the data dropped out of the `draggable` object.

My code is something like this ... 

var viewModel = kendo.observable {
    Cart : [],
    Items : [
    {
      Id : "item/10",
      Name: "CD ROM"
    },
    {
      Id : "item/11",
      Name: "DVD ROM"
    }
};

So then I have a rough template binding...

<script id="products-template" type="text/x-kendo-template">
    <li class="draggable">
        <div data-bind="text: Name"></div>
    </li>
</script>



Then this gets called up in a list...

 
<div id="shopping-items-available">
    <ul data-template="products-template" data-bind="source: Items">
    </ul>
 </div>


Then there is a standard "drop target" (taken from the kendo docs)

<div id="droptarget">Start dragging.</div>


with the following CSS

 
#droptarget {
     border: 1px solid #959595;
     height: 198px;
     width: 300px;
     font-size: 36px;
     border-radius: 37px;
     text-align: center;
     line-height: 198px;
     color: #a1a1a1;
     text-shadow: 0 1px 1px #fff;
     margin: 0 0 30px 220px;
     cursor: default;
     background: #dddddd;
     background: -moz-linear-gradient(top, #dddddd 0%, #c1c1c1 100%);
     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dddddd), color-stop(100%,#c1c1c1));
     background: -webkit-linear-gradient(top, #dddddd 0%,#c1c1c1 100%);
     background: -o-linear-gradient(top, #dddddd 0%,#c1c1c1 100%);
     background: -ms-linear-gradient(top, #dddddd 0%,#c1c1c1 100%);
     background: linear-gradient(top, #dddddd 0%,#c1c1c1 100%);
 }


Now in the javascript, I turn the `shopping-items-available` div into a `draggable`.

$("body").kendoDraggable({
   hint: function (target) {
       return $(target).clone().addClass("draggable");
   },
   filter: ".draggable"
});



and lastly, I initialize the drop target.

$("#droptarget").kendoDropTarget({
   drop: droptargetOnDrop
});


but in my code, I cannot seem to get the actual data about the item that was dropped.

function droptargetOnDrop(e) {
   console.log(e);
   $("#droptarget").text("You did great!");
   $(".draggable").removeClass("hollow");
}


So the question is, how can I get the data that should be part of this? Like the name, or the Id? 
Petyo
Telerik team
 answered on 12 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?