Telerik Forums
Kendo UI for jQuery Forum
15 answers
112 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
475 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
914 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
85 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
423 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
194 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
75 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
233 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
323 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
1 answer
195 views
Sorry for the cross-posting but going crazy on this one.

http://stackoverflow.com/questions/18151901/kendoui-datasource-results-in-invalid-json-primitive

So essentially, when I use a Kendo Data Source and send anything in the data: field as part of the transport/read command this is what I see come across in fiddler in the json request.

0=%7B&1='&2=s&3=U&4=s&5=e&6=r&7=n&8=a&9=m&10=e&11='&12=%3A&13='&14=a&15=d&16=m&17=i&18=n&19=%40&20=m&21=a&22=i&23=l&24=.&25=c&26=o&27=m&28='&29=%2C&30='&31=s&32=P&33=a&34=s&35=s&36=w&37=o&38=r&39=d&40='&41=%3A&42='&43=1&44=3&45=1&46=2&47=3&48='&49=%2C&50='&51=s&52=U&53=s&54=e&55=r&56=I&57=D&58='&59=%3A&60='&61=1&62=5&63=3&64=9&65='&66=%2C&67='&68=s&69=C&70=l&71=u&72=b&73=I&74=D&75='&76=%3A&77='&78=1&79='&80=%7D

If I don't use the Kendo Data Source and just a common ajax request I don't see these problems at all.  Just curious if anyone has seen this before.  I must be doing something stupid.

Thanks,

Richard
Richard
Top achievements
Rank 1
Veteran
 answered on 11 Aug 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
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
Iron
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
Iron
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?