Telerik Forums
Kendo UI for jQuery Forum
7 answers
1.2K+ views
I've attached event listeners to every data source and grid event but none seem to allow me to refresh the grid without harming the newly added data or next-added data. DataSource's change event when only e.actions == "itemchange" seemed the closest but I'd have to add a setTimeout. I had problems with the grid's edit and save events (both called too soon). I was using grid.refresh(). Another approach is appreciated
Petur Subev
Telerik team
 answered on 01 May 2014
1 answer
404 views
Hi,

I have two drop downs on a row in the Kendo UI grid, the user is only allowed to have one selected at a time. Therefore I need to handle a change event on either of the drop downs to - 

1) Identify which drop down the event is coming from
2) Alter the data/dom of the other drop down to be empty. 

I've had a few attempts and can't come up with anything clean. I think my ideal solution would be to update the grid datamodel on the client side and get it to rebind. I've trying altering it on the ajax update call but that means reading the entire contents again (or does it?)

Anyway I hope you get the drift, here is how my grid looks at the moment - 

@(Html.Kendo().Grid<Forth.AE.Web.ModelViews.Step6MV>()
                            .Name("Grid")
                //.ClientEvents(events => events.OnEdit("Grid_onEdit"))
                            .Columns(columns =>
                            {
                                columns.Bound(p => p.MyID).Title("MyID").Visible(false);
                                columns.Bound(p => p.DropDown1).ClientTemplate("#=ModelItem1.DropDown#").Width(250);
                                columns.Bound(p => p.DropDown2).ClientTemplate("#=ModelItem2.DropDown#").Width(250);
                            })
                            .Editable(editable => editable.Mode(GridEditMode.InCell))
                            .Sortable()
                            .DataSource(dataSource => dataSource
                                .Ajax()
                                .AutoSync(true)
                                .Batch(true)
                                .PageSize(200)
                                .ServerOperation(false)
                                .Events(events => { events.Change("onChange"); })
                                .Events(events => events.Error("error_handler"))
                                .Model(model =>
                                {
                                    model.Id(p => p.MyID);
                                    model.Field(p => p.DropDown1).DefaultValue(
                                        ViewData["defaultDD"] as Forth.AE.Web.ModelViews.DDModel);
                                    model.Field(p => p.DropDown2).DefaultValue(
                                        ViewData["defaultDD"] as Forth.AE.Web.ModelViews.DDModel);
                                })
                                .Read(read => read.Action("Grid_Read", "Grid"))
                                .Update(update => update.Action("Grid_Update", "Grid"))
                             )
        )

and I'm using this EditorTemplate - 

@model Forth.AE.Web.ModelViews.DDModel

@(Html.Kendo().DropDownListFor(m => m)
            .DataValueField("ID")
            .DataTextField("DropDown")
            .BindTo((System.Collections.IEnumerable)ViewData["myValues"])
            .Events(e =>
            {
                e.Change("Change");
            })
            .Events(e =>
            {
                e.Select("Select");
            })
)

As you can see I'm trying to hook up to the Change or Select events but the information that is passed through to the javascript function looks like I need to traverse the DOM and start hacking at it. 

Is there a cleaner way I can do what is needed? Any suggestions mooooore than welcome!

Atanas Korchev
Telerik team
 answered on 01 May 2014
1 answer
255 views
Hello,

I am using JavaScript implementation of AutoComplete that is wired directly onto Web API. I need to get the typed content of the textbox in the Web API. Is that any easy way how to serialize the object that is being passed from the JavaScript (probably OData object) to some class in C# in Web API? The object seems to contain filtering, paging etc.

I know that this is designed to be used with MVC but I need to make it work somehow with Web API.

Thank you,

Jakub
Georgi Krustev
Telerik team
 answered on 01 May 2014
6 answers
103 views
I am testing and evaluating kendoUI. I am filling the grid with data form a remote database, the info came correctly and I can fill the grid. I can filter, sort, and also I can show lines with the pageSize command. The only one that is not working for me is the "pageable", down the grid it appears all the buttons, but It seems not to have any register, and there they are. Of course any pageable button works. Here is my simple code:

Here is the link to web:  http://www.midilusa.com/sistema/prueba_kendoUI/prueba.php

Here is it´s code:


        <div id="example" class="k-content">
            <div id="grid"></div>
            <script>
                $(document).ready(function() {
                    $("#grid").kendoGrid({
                        dataSource: {
                            transport: {
                                read: {
                                    url: "pais.php",
                                    dataType: "json"
                                }
                            },
                            schema: {
                                total: function(response) {
                                return response.total; // total is returned in the "total" field of the response
                                },   
                            },                      
                        pageSize: 10,      
                        },
                        pageable: true,
                        filterable: true,
                        sortable: true,
                        groupable: true,
                    });
                });
            </script>
        </div>



Rosen
Telerik team
 answered on 01 May 2014
5 answers
184 views
Hello,

I have a small scroll view generated dynamically when I retrieve some data from the server.

Basically, I have the following template:

<script id="friendsToInvite-template" type="text/x-kendo-template">
            <p class="friendName">#= name #</p>
            <div style="width: auto; height: 180px; background: url('https://graph.facebook.com/#= fbId #/picture?type=large')  no-repeat center;"></div>
            #if( invited ) {#
                <p class="friendsButtons"><button class="button2 btn-green unInvite" data-fbid="#= fbId #" data-eventid="#= eventId #">Invited</button></p>
            #} else {#
                <p class="friendsButtons"><button class="button2 btn-orange invite" data-fbid="#= fbId #" data-eventid="#= eventId #">Invite</button><!-- /*<button class="button2 btn-grey">Dont show me again</button>*/ --></p>
            #}#
        </script>

As you can see, I have a button with a class of invite or uninvite depending on the scenario.
In my js, I have a event listener binded to the on click action that trigger a js function. But unfortunately, I'm noticing that after the second element, the buttons do not trigger the js function as they are generated when the user scroll from an element to another ( I believe its better for perfs, great) 


So my question is, how do I bind an event to my button in this scroll view for every element generated by Kendo UI when a user is swiping from an element to another ? If possible, I'd like to avoid listening for a user moving from an element to the other to rebind my buttons again (and onclick does not work on phonegap I think).

Thank You :)
Kiril Nikolov
Telerik team
 answered on 01 May 2014
2 answers
177 views
In KendoUI chart, when aggregating series data for a category, one would expect that the dataItem for the point would contain all the actual data points used to construct that dataItem. Since the point on the graph is an aggregate, its reasonable to assume that more than one piece of data was used to construct it.

For example, given the series data:
                   [
                      {'Operation': 'A', 'Cost': 2.5, 'StartTime':'2014-04-02T00:00:00-07:00'},
                      {'Operation': 'B', 'Cost': 2.5, 'StartTime':'2014-04-02T00:00:00-07:00'},
                      {'Operation': 'C', 'Cost': 3, 'StartTime':'2014-04-03T00:00:00-07:00'},
                      {'Operation': 'D', 'Cost': 3, 'StartTime':'2014-04-03T00:00:00-07:00'}    
                    ]

Where categoryField is 'StartTime',  (value) field is 'Cost' and aggregate is 'sum',  we can then assume that we will have 2 data points on the graph:

2014-04-02 = 5
2014-04-03 = 6

When we look at the dataItem for the first point (in a tooltip for example), we would assume that somehow 'A' and 'B' would be represented.  However the data point looks like 'A', with 'Cost' set to the aggregate of A+B.

So it seems instead of returning the set of items in the point aggregate, kendo is doing some sort of weird merging of the point (probably just taking the first) and merging in the aggregate.

Take a look at this example, when hovering the chart item, look at the console output for the dataItem.   Also note series.data is now missing B and D respectively.

http://trykendoui.telerik.com/@jsconnell@2ndwatch.com/ASEM

Am I wrong to make this assumption, or is this a bug?
James
Top achievements
Rank 1
 answered on 30 Apr 2014
2 answers
66 views
I've been having a problem getting the Grid widget to render out.  I've been getting the following output with no table, header or footer.

[object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object]

I finally traced the problem to a reference to the Dataviz script that I had referenced next to Kendo Web.  I tried the kendo.all and the problem went away but not before wasting a bunch of time trying to figure out what the problem was.  I tried reproducing the problem with one of the Grid examples in the Dojo but no luck.  Should the scripts not be used side by side in this way?
RES
Top achievements
Rank 1
 answered on 30 Apr 2014
1 answer
122 views
I wish to set the Target bar to show a range.  My desire is to have the target bar show the min and max value (range) and then a line as the current value.  Right now I can only set the target value Max which shows a bar from the origin of the chart to the set value.  I wish to control both ends of the target bar.   Is this possible.
Iliana Dyankova
Telerik team
 answered on 30 Apr 2014
1 answer
2.4K+ views
Hello Telerik,

I want to handle the "enter" key while keyboard navigation is enabled.

I could handle the keydown event within the tbody.

I need to handle a keypress event in a custom editor too. And here comes the trouble.. I registered a keypress event in the custom editor but is never fired with the "enter" key. The other keys like letters and numbers fire the event.

I could reproduce my code logic here:
http://trykendoui.telerik.com/onaD

am I missing something? My requirement is to handle keydown => keypress => and keyup in the editor.
The keydown and keyup is firing ok. 

Can you help me?

Thank you in advance, 

regards
Vladimir Iliev
Telerik team
 answered on 30 Apr 2014
2 answers
113 views
I'm using multiple treeviews on a page, bound to WCF services on a NTLM authenticated website.  If more than a single treeview is requesting data to come from the webservice only the first works and the others immediately fail.  On the server side for some reason it's because the subsequent requests are coming in unauthenticated.  However if I put in a setTimeout()s on the extra treeviews so they load sequentially there's no errors.  Instead of relying on an uncertain setTimeout()s, is there any way to have a treeview retry it's dataload on failure, or do you have any ideas on how to get multiple simultaneous requests to NTLM authenticated wcf services to work?
Elizabeth
Top achievements
Rank 1
 answered on 30 Apr 2014
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
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?