Telerik Forums
Kendo UI for jQuery Forum
2 answers
861 views
hi,

Is there any way to programmatically get the datasource in a grid with the items sorted as the user has selected?

The following:

$(grid).data("kendoGrid").dataSource.view()

takes into account grid paging also, and does not return the items of the entire datasource sorted. Can I get somehow all dataitems sorted regardless of paging?

Thanks in advacne

Michalis
Top achievements
Rank 1
 answered on 17 Dec 2012
2 answers
111 views
Hi,

Would you please surround grid popup editor buttons with div tag so that they do not wrap around in some cases when custom styling is used.

At present your code looks like:
html += that._createButton({ name: "update", text: updateText, attr: attr }) + that._createButton({ name: "canceledit", text: cancelText, attr: attr });
However it should look like:
html += '<div>' + that._createButton({ name: "update", text: updateText, attr: attr }) + that._createButton({ name: "canceledit", text: cancelText, attr: attr }) + '</div>';
Sypher
Top achievements
Rank 1
 answered on 17 Dec 2012
1 answer
862 views
Hi All,

As per project requirement, I have to display kendo list-view as popup on button/link click?
How we can do that? Please help in this case. Immediate response would be appreciated.

Regards,
Partha.
Vladimir Iliev
Telerik team
 answered on 17 Dec 2012
1 answer
121 views
Hi,

I have a touch event in a kendo template illustrated in the following jsBIN:
http://jsbin.com/isatoz/33/edit

Can you tell me why this don't work?

Thanks,
Martin
Petyo
Telerik team
 answered on 17 Dec 2012
1 answer
1.1K+ views
Hi,

I am using kendo tabstrip to display kendo tree view component.

I have populated kendo tree view by using hierarchical JSON structure, some of the nodes are too long to display it inside the tab hence I need to wrap the node text. Is there a way to wrap node text?

Thanks,
Barani
Petur Subev
Telerik team
 answered on 17 Dec 2012
5 answers
434 views
My form has a simple Datepicker on it, which paints and apparently operates correctly, but when I post the results with the submit button, although the rest of the fields go through correctly, the one with the datepicker doesn't. 

For example, I have a part of my form like this:

<tr><td class=view><font color=red>Third Phone Type</td><td class=view><input type=hidden name="oldfield13" value="Not Given"><select  id="i13"  class=view name="field13">
<option value=""></option>
<option selected value="Not Given">Not Given</option>
<option value="Home">Home</option>
<option value="Office">Office</option>
<option value="Mobile">Mobile</option>
<option value="Direct Dial">Direct Dial</option>
<option value="Primary">Primary</option>
</select>
</td></tr>
<tr><td class=view>Contact EMail Address</td><td class=view><input type=hidden name="oldfield14" value="xxxx23285@gmail.com"><input type=text class=view name=field14 value="arun23285@gmail.com"></td></tr>
<tr><td class=view>Payslip EMail Address</td><td class=view><input type=hidden name="oldfield15" value=""><input type=text class=view name=field15 value=""></td></tr>
<tr><td class=view><font color=red>Gender</td><td class=view><input type=hidden name="oldfield16" value="Female"><select  id="i16"  class=view name="field16">
<option value=""></option>
<option value="Not Given">Not Given</option>
<option value="Male">Male</option>
<option selected value="Female">Female</option>
</select>
</td></tr>
<tr><td class=view>Date of Birth</td><td class=view><input type=hidden name="oldfield17" value="1 July 1986 00:00:00"><input  id="i17"  type=text class=view name=field17 value=""></td></tr>

....

and then some time later, at the end, I have 

<script>
$(document).ready(function() {
$("#i17").kendoDatePicker({format:"dd MMM yyyy"})
});
</script>

I pick a date, when I close the datepicker window, the 
value has filled in on the text box, 
and then when I post, I have a debug routine that reads all 
the posted data, and displays it in a table.
I get this (amongst other stuff)
then some time later, at the end, I have 
oldfield13 Not Given
field13 Not Given
oldfield14 xxxx23285@gmail.com
field14 xxxx23285@gmail.com
oldfield15
field15
oldfield16 Female
field16 Female
oldfield17 1 Jan 1900 00:00:00
oldfield18 Indian
field18 Indian
Notice how there's no entry for the datepicker field, which is named field17 - not even an empty field posted. Also notice that I've definitely set the name attribute on the input field. 

I'm using the latest version of Kendo UI (just redownloaded it today to check). The datepicker also behaves like this, even if I don't open up the date widget and type the date in (in dd/MMM/yyyy format). What do you think the problem is?


Clive
Top achievements
Rank 1
 answered on 17 Dec 2012
2 answers
415 views
Hi,

I'm trying to set initial values for a group of dropdowns that are linked (cascade).

Example: http://jsfiddle.net/klystofer/pY3rc/5/

What is the best way to do this?

Regards,
Klystofer
Uilton
Top achievements
Rank 1
 answered on 17 Dec 2012
1 answer
779 views
I have quite the odd script going to try and get something working that is fairly hacked together. I have 2 DropDownLists, one is a standard DropDownListFor and the other is a KendoDropDownList that I have used some javascript I found on these forums to insert a KendoTreeView into it's contents. What I'm trying to achieve is to change the datasource of the treeview based on the selection of the first DropDownList. I have accomplished this but I am now getting an error when trying to update the datasource on the treeview. The error occurs in kendo.web.min.js and is in the following block:

_attachUids: function(b, d) {
            var e = this, f, g = c.attr("uid");
            b = b || e.root, d = d || e.dataSource, f = d.view(), b.children("li").each(function(b, c) {
                c = a(c).attr(g, f[b].uid), e._attachUids(c.children("ul"), f[b].children)
            })
With this error text:

  1. Uncaught TypeError: Cannot read property 'uid' of undefined kendo.web.min.js:8376
    1. (anonymous function)kendo.web.min.js:8376
    2. jQuery.extend.eachjquery-1.7.1.js:661
    3. jQuery.fn.jQuery.eachjquery-1.7.1.js:271
    4. i.extend._attachUidskendo.web.min.js:8375
    5. (anonymous function)kendo.web.min.js:708
    6. jQuery.extend.eachjquery-1.7.1.js:661
    7. jQuery.fn.jQuery.eachjquery-1.7.1.js:271
    8. a.fn.(anonymous function)kendo.web.min.js:707
    9. (anonymous function)Create:249
    10. jQuery.event.dispatchjquery-1.7.1.js:3261
    11. elemData.handle.eventHandle


Here is the offending code that this is called from:

@Html.LabelFor(model => model.Incident.RequestType)
@Html.DropDownListFor(model => model.Incident.RequestType, new SelectList(Model.RequestTypes, null, "Name"))
@Html.ValidationMessageFor(model => model.Incident.RequestType)
               <script>
                   $(function() {
                       $('#Incident_RequestType').change(function () {
 
                           var elems = document.getElementsByTagName('*'), i;
                           for (i in elems) {
                               if ((' ' + elems[i].className + ' ').indexOf(' k-input ')
                                       > -1) {
                                   elems[i].innerHTML = '';
                               }
                           }
                            
                          // Get new datasource
                          var subjectDataSource = new kendo.data.HierarchicalDataSource({
                               transport: {
                                   read: {
                                       dataType: "json",
                                       type: "POST",
                                       url: "/Incident/GetSubjectsByRequestType/",
                                       data: { //additional parameters sent to the remote service
                                           requestType: function () {
                                               return $("#Incident_RequestType").val();
                                           }
                                       }
                                   }
                               },
                               schema: {
                                   model: {
                                       id: "RequestType",
                                       hasChildren: "HasChildren",
                                       children: "Children"
                                   }
                               }
                           });
 
                          // Update datasource on treeview
                           subjectDataSource.read();
                           $("#treeview").kendoTreeView({
                               dataSource: subjectDataSource,
                               dataTextField: ["Title", "Title"],
                               loadOnDemand: false
                           }).data("kendoTreeView");
                       });
                   });
                   
               </script>

I cannot figure out what to do to get this working without throwing the error. The datasource does get updated and it all seems to work okay in Chrome but the error is getting thrown and IE complains about it when debugging. Any help would be appreciated.

Thanks,

Brian
Daniel
Telerik team
 answered on 17 Dec 2012
6 answers
1.0K+ views
I've been using Telerik products for a while now and have recently moved my team to using KendoUI. One big difference I noticed about grids is the change in event handlers. In this instance, I have a custom command button that should perform some kind of task like toggling an active/inactive state. It does fire the custom command's event handler as expected, but it also appears to fire the change() event.

Is this the intended behavior of the framework, or is there a way to execute a custom command without having the change() event fire as well?

Sample code:
<script type="text/javascript">
    function OnToggleClick(e) {
        e.preventDefault();
        alert("Command has been clicked");
    }
    function OnRowSelect(e) {
        e.preventDefault();
        alert(this.dataItem(this.select()).ID);
    }
</script>

@{Html.Kendo().Grid<MyModel>()
.Name("MyGridName")
.DataSource(db =>
db.Ajax()
.Model(o => o.Id(x => x.ID))
.PageSize(20)
.Create("InsertNewRecord", "Setup")
.Read("GetRecords", "Setup")
)
.Events(ev => ev.Change("OnRowSelect"))
.Columns(col =>
{
col.Bound(o => o.ID).Title("ID");
col.Bound(o => o.Field1).Title("Field1");
col.Bound(o => o.Field2).Title("Field2");
col.Bound(o => o.IsActive).Title("ToggleMe");
col.Command(com =>
{
com.Custom("ToggleActive").Text("Toggle").Click("OnToggleClick");
}).Width(80);
})
.ColumnMenu().Pageable().Filterable().Sortable().Selectable()
.Scrollable(scroll => scroll.Height(340))
.Render();
}

Thank you,
-J
Petur Subev
Telerik team
 answered on 17 Dec 2012
4 answers
1.1K+ views
Hello,

I'm building external search filter for kendo Grid. 
In the filter i have two datepickers, When i'm trying to parse the value of the date pickers and pass to the action in the controller via external atribute grid->datasource->read-data()! i get the date time string in format  "Sat Dec 08 2012 00:00:00 GMT+0100 (Central European Standard Time)" and then i cant parse that datatime string to actual datetime object! Can someone help with this!

Regards,
Philip Selvievski
Georgi Krustev
Telerik team
 answered on 17 Dec 2012
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
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
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?