Telerik Forums
Kendo UI for jQuery Forum
4 answers
128 views
I have a case where the datasource object is passing a blank $filter param. When using the MVC4 RC Web-api it throws an error because the filter is blank. 

Here is a sample URL the datasource is calling:
http://localhost:3046/api/clients?%24inlinecount=allpages&%24format=json&%24top=50&%24filter=

What appears to be happening is that it only adds the blank filter if I clear out the search criteria  (right now I just have this bound to a combo box). So when I type in something to the combo, it makes the call to the server, filters correctly. But if I clear that, it will pass a blank filter.

How can I intercept that to make sure it isn't even passing the filter?
Alexander Valchev
Telerik team
 answered on 18 Jun 2012
1 answer
59 views
When we press the enter key without selecting any item from the opened list area of an Autocomplete kendo plug-in, we may get an error 
"Line: 217. Error: Unable to get value of the property 'index': object is null or undefined"
in IE9. This is because the "item" object of the passed-in parameter "e" is null. The following fixed me this issue.

if (e.item == null) return;
                var dataItem = this.dataItem(e.item.index());
I hope that a developer like me, makes use of this.
Georgi Krustev
Telerik team
 answered on 18 Jun 2012
1 answer
74 views
After setting the animation to false, try to expand the panel contains some sub-panels and then collapse it and then expand it again, the sub-panels within this panel will not work properly. 
Kamen Bundev
Telerik team
 answered on 18 Jun 2012
3 answers
200 views
I am trying to get DnD to work from a TreeView to another component.  

How do I get the item from the TreeView on drop?  I have tried e.draggable, but I cannot find the item there.  
     
I have also tried calling $("treeview").data('kendoTreeView").select(), but it only returns the html and not the item.
This method also has the problem where if the item is dragged, but not selected, select returns nothing.

Thanks for the help.

Adam


Alex Gyoshev
Telerik team
 answered on 18 Jun 2012
2 answers
237 views
Hello! I am new kendo ui and i am developing a mobile web application for an institute. At first stage, I want to show all the courses which contains 5 columns(eg name, details...). My question is how can I return these data to data reader and bind to listview?

Thanking you in advance!
Dhananjay
Top achievements
Rank 1
 answered on 18 Jun 2012
0 answers
356 views
Hi,

I am trying to create a ListView of items. I am trying to make it such that when a user clicks on the "rowdelete" detail button, that particular row gets updated or deleted in the dataSource, and the ListView gets synced to that.

I declare my list view with a template like this:

<ul id="flat-listview" style="font-size: .8em"></ul>
<script type="text/x-kendo-template" id="customListViewTemplate">
${name}: ${qty}<a data-role="detailbutton" data-style="rowdelete" data-click="deleteItem"></a>
</script>

The functions to refresh the ListView and add items to it are as follows:
<script>
function reinitListView() {
$("#flat-listview").kendoMobileListView({ 
dataSource: kendo.data.DataSource.create({data: dataList}), 
template: $("#customListViewTemplate").html(),
});
}

function addToList(item) {
for (var i = 0; i < dataList.length; i++) {

if (dataList[i].name == item) {
dataList[i].qty++;
reinitListView();
return;
}
}
dr = new Object();
dr.name = item;
dr.qty = 1;
dataList.push(dr);
reinitListView();
}
</script>

I tried writing a function called deleteItem (called when the button is clicked), but I don't know how to access the list view row from there. 
Sherry
Top achievements
Rank 1
 asked on 18 Jun 2012
1 answer
157 views
Hello, Its been week and still no luck on dropdown and finally I'm throwing up my towel. I hope you can help me on this.


          
         var lastNameData =[{"lastName":"White","lastNameID":0},{"lastName":"Great","lastNameID":1}];
          
               var lastNameDataSource = new kendo.data.DataSource({
        data: lastNameData,
            schema: {
            model: {
                id: "lastNameID"
            }
        }
    });
             
             
             
          
          
         function lastNameDropDownEditor(container, options) {
                         
                  $('<input data-bind="value:' + options.field + '"/>')
    .appendTo(container)
    .kendoComboBox({
         autoBind: false,
        dataTextField: "lastName",
        dataValueField: "lastName",
        dataSource: lastNameDataSource
    });
                }
          
var blankData;
                $(document).ready(function () {
                    var dataSource = new kendo.data.DataSource({
                         
                                parameterMap: function(options, operation) {
         
        //alert(operation);
                                    if (operation !== "read" && options.models) {
                                        return {models: kendo.stringify(options.models)};
                                    }
                                   
                                    },
                 
                transport: {
                     
         read: {
dataType: "json",
 type: "POST",
data: {"SQLCMD":"SELECT * FROM gridTest","Table":["firstName","nickName","lastName"],"PrimaryKey":"peopleID"}
},
         update: {
            type: "POST"
         },
         destroy: {
             type: "POST"
          },
          create: {
              type: "POST",
               data: {
                req: ["firstName","nickName"]                }
               
               
           }
         },
                
         // determines if changes will be send to the server individually or as batch
         batch: false,
         //...
 
 
                       pageSize: 30,
                       data: blankData,
                       autoSync: true,
                       schema: {
                           model: {
                             id: "peopleID",
                             fields:
                                {"peopleID":{"editable":false,"nullable":true},"firstName":{"type":"string","validation":{"required":true},"nullable":false,"defaultValue":""},"nickName":{"type":"string","validation":{"required":true},"nullable":false,"defaultValue":""},"lastName":"lastName"}                             }
                           ,  parse: function (data) {
        // alert(data);
            return data;
        }
                       }
                    });
 
                    $("#grid").kendoGrid({
                        dataSource: dataSource,
                        pageable: true,
                        height: 340,
                        toolbar: ["create"],
                        columns:
                            [{"field":"firstName","title":"First name"},{"field":"nickName","title":"Nick Name"},{"field":"lastName","width":"150px","editor":"lastNameDropDownEditor"},{"command":"destroy","title":" ","width":"110px"}]                            ,
                             
                        editable: true
                    });
                });


Please help! thanks!
Mike
Top achievements
Rank 1
 answered on 17 Jun 2012
0 answers
117 views
I would like clicking on a selected node to do the same thing as clicking on an unselected node.
Triggering the "select" event even it its selected would be fine but any other solution
to trigger SOME event if the node is already selected is fine too.
Christopher
Top achievements
Rank 1
 asked on 16 Jun 2012
0 answers
493 views
I added a datepicker control to a grid for edit mode. When the updates, it displays a long format time string. I would like to format the time as a short date string, but I have not found the event to delegate. The code below demonstrates the problem:

            <div id="grid"></div>

            <script language="javascript" type="text/javascript" >

                $(document).ready(function ()
                {

                    $("#grid").kendoGrid({
                        dataSource:
                        {
                            data:
                            [
                                {Employee:"Joe Jones",Dept:"Sales",Job:"Account manager",DateVal:"1/2/2012"},
                                {Employee:"Samantha Smith",Dept:"Marketing",Job:"Design",DateVal:"2/3/2012"}
                            ]
                        },
                        pageable: true,
                        height: 455,
                        filterable: true,
                        sortable: true,
                        scrollable: { virtual: false },
                        selectable: 'row',
                        columns: [
                            { field: "Employee", title: "Employee" },
                            { field: "Dept", title: "Department" },
                            { field: "Job", title: "Job" },
                            {
                                field: "DateVal",
                                title: "Date Hired",
                                editor: function (container, options)
                                {
                                    $('<input id=\"' + options.field + '\" />').appendTo(container)
                                    .kendoDatePicker({ format: "MM/dd/yyyy" });

                                    var datePicker = $("#DateVal").data("kendoDatePicker");
                                    // bind to the close event
                                    datePicker.bind('close', function (e)
                                    {
                                        var datepicker = e.sender.element.kendoDatePicker()
                                        var d = new Date(datepicker.val());
                                    });

                                }
                            },
                            { filterable: false, command: ["edit"], title: "&nbsp;", width: "210px"}],
                        editable: "inline"
                    });

                });

</script>

Click "Edit", then a date from the datepicker control, then look at the resulting time string in the grid.
Sorry if I posted this in the wrong forum before.
John
Top achievements
Rank 1
 asked on 15 Jun 2012
0 answers
69 views

I created a datepicker column in the grid for edit mode. It works, but when the grid gets the date from the datepicker, the time string is in long format. I would like to be able to change this to a short date, but I have not been able to determine how to intercept the update. Past the code below into a page to see what happens. How can I change the date format in the grid to show a short date after editing? Thanks.

           <div id="grid"></div>

            <script language="javascript" type="text/javascript" >

                $(document).ready(function ()
                {

                    $("#grid").kendoGrid({
                        dataSource:
                        {
                            data:
                            [
                                {Employee:"Joe Jones",Dept:"Sales",Job:"Account manager",DateVal:"1/2/2012"},
                                {Employee:"Samantha Smith",Dept:"Marketing",Job:"Design",DateVal:"2/3/2012"}
                            ]
                        },
                        pageable: true,
                        height: 455,
                        filterable: true,
                        sortable: true,
                        scrollable: { virtual: false },
                        selectable: 'row',
                        columns: [
                            { field: "Employee", title: "Employee" },
                            { field: "Dept", title: "Department" },
                            { field: "Job", title: "Job" },
                            {
                                field: "DateVal",
                                title: "Date Hired",
                                editor: function (container, options)
                                {
                                    $('<input id=\"' + options.field + '\" />').appendTo(container)
                                    .kendoDatePicker({ format: "MM/dd/yyyy" });

                                    var datePicker = $("#DateVal").data("kendoDatePicker");
                                    // bind to the close event
                                    datePicker.bind('close', function (e)
                                    {
                                       // See what the datepicker is returning:
                                        var datepicker = e.sender.element.kendoDatePicker()
                                        var d = new Date(datepicker.val());
                                    });

                                }
                            },
                            { filterable: false, command: ["edit"], title: "&nbsp;", width: "210px"}],
                        editable: "inline"
                    });

                });
</script>

John
Top achievements
Rank 1
 asked on 15 Jun 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
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
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?