Telerik Forums
Kendo UI for jQuery Forum
1 answer
435 views
Hi,

I've noticed that if you press Enter key from keyboard when no item is selected in combobox, the first item automatically get selected. Is there anyway to prevent this in configuration settings without using javascript events? I don't want to add an extra keydown event each time i use a combobox in my pages.  If there is an enable/disable option for this behavior it will be great. (i am using aspnet-mvc wrapper by the way...)

Thank you.


Noldor
Top achievements
Rank 1
 answered on 10 Oct 2013
1 answer
181 views
I have a page with 4 autocomplete fields and one text field all in a row. The fields are used to apply filters to a grid. When I enter something in the plain text field, and apply the filters to the grid, everything works fine. The filters are applied and the data in the grid is reduced. When I then click a link in the grid to view the detail page for the record, and then click the back button to get back to the grid, the value that was in the text field is displayed in the first autocomplete box for some reason. 

I save the grid state to localStorage using the dataBound event of the grid:

$('.grid').kendoGrid({
    ...
    dataBound: this.saveGridState
    ...

Where this.saveGridState is: 

var grid = $('.grid').data('kendoGrid');
  var dataSource = grid.dataSource;
  var state = JSON.stringify({
    page: dataSource.page(),
    pageSize: dataSource.pageSize(),
    sort: dataSource.sort(),
    group: dataSource.group(),
    filter: dataSource.filter()
  });
  localStorage.setItem('gridState', state);

I load the state when the document is ready using:
$(document).ready(function(){
    var state = JSON.parse(localStorage.getItem('gridState'));
    var grid = $('.grid').data('kendoGrid');
    if(state && Object.keys(state).length > 0) {
      if(state.filter && state.filter.filters) {
        ctx.showFiltersInInputs(state.filter.filters);
      }
      grid.dataSource.query(state);
    }
    else {
      grid.dataSource.read();
    }
  });

I initially thought that the function I use to put the filters back into their inputs was mistakenly putting the data in the wrong field. However, if i set a breakpoint in chrome before any of the kendo related javascript, I still see the value in the wrong field. It appears the autocomplete is somehow persisting the value in the plain text field when I browse to the detail page and sticking it in the first autocomplete. Seems really weird. Any idea what this could be?

Thanks,

Troy
Kiril Nikolov
Telerik team
 answered on 10 Oct 2013
1 answer
229 views
Using 2013.9.18

I'm defining a kendoScheduler with 
timezone: "Etc/UTC"
It works great, in my database the times are stored in UTC and depending on whether I load the page in San Francisco (GMT+7) or Minneapolis (GMT+5), the same event shows two different starting times depending on the user's geographical location. The kendoScheduler seems to convert the dates to local time and this is great for me. (The documentation indicates it should do the opposite, but this is the effect I wanted so for now I'm happy).

The problem is that it computes local time wrong. In Minneapolis, it takes GMT and adds 5 and in San Francisco, it takes GMT and adds 7. It should be subtracting these values, not adding them! If it's 00:00 GMT, it's 17:00 the previous day in San Francisco, not 07:00.

Has anyone else had the same sort of issues? Searching the forums, it seems like I'm not the only one encountering this.



Matt Johnson
Top achievements
Rank 1
 answered on 10 Oct 2013
6 answers
290 views
var dataSource = new kendo.data.DataSource({
        transport: {
          read: {
            url: "http://localhost/apartment/data.php?api=profile",
            dataType: "json",
            type: "GET"
          }
        }

    });

    var viewModel = kendo.observable({
      datasource: dataSource
    });

   var listView = new kendo.View("profile-template", {
    model: viewModel
   });

    var listHtml = listView.render();
    $("#profile-view table").html(listHtml);

  My TEMPLATE: 
  
   <script id="profile-template" type="text/x-kendo-template">
   <tr>
     <td>Name</td><td> <span>#= datasource.name #</span></td>
   </tr>
   <tr>
     <td>Email</td><td>#= name #</td>
   </tr>
   <tr>
     <td>Mobile Number</td><td>9629014027</td>
   </tr>
   <tr>
     <td>Apartment</td><td>Green Age</td>
   </tr>
 </script>

Parag
Top achievements
Rank 1
 answered on 10 Oct 2013
2 answers
690 views
I was wondering if there is a way to manipulate the dropdownlist popup in order to make it behave like a modal that is centered on the screen?  I really like how on the Android Chrome browser, an HTML select element pops up a modal that takes up the whole screen and allows the user to make a choice when it is activated.  Is there any way I can duplicate this kind of functionality on a kendo dropdownlist?
Mike
Top achievements
Rank 1
 answered on 09 Oct 2013
20 answers
318 views
Hi,

As basic as this question may seem, I've been wrestling with it for several days with no solution. I have a chart where I was once using a datasource. I am no longer using a datasource and would like to manually add the series with its data to the chart via chart.options.series.push and chart.options.navigator.series.push. Currently, when I add a series to the chart through chart.options I can see the line series. I am trying to add that same series to the navigator using chart.options, but the navigator doesn't show the series. In fact, the navigator is not even visible. Here is my chart creation and addseries function code. Please help!

Thanks much,
Tonih

function createChart() {
                     
                    $("#chart").kendoStockChart({
                         
                         
                        tooltip: {
                             visible: true,
                             shared: true,
                             background: "white",
                        },
                        seriesDefaults: {
                            type: "line",
                        },
                         
                        valueAxis: {
                            name: "straight",
                            visible: true,
                            labels: {
                                format: "{0}%"
                            }
                        },
                        navigator: {
                          series: [{
                            type: "line",
                            width: 1,
                            missingValues: "interpolate",
                          }],
                          categoryAxis: {
                              baseUnit: "yearly",
                              majorTicks: {
                                  visible: "false",
                                  color: "white",
                              },
                              minorTicks: {
                                  size: 3,
                              },
                          }
                        }
                    });
                }
 
 
 
function addSeries(){
             
                     
                    var chart =  $("#chart").data("kendoStockChart");
                    var chartOptions = chart.options;
 
 
                    chartOptions.series.length = 0;
                 
                     
                    for( series in plotSeriesCollection){
                        var name = plotSeriesCollection[series].id;
 
                        var data = [];
 
                        for(obs in plotSeriesCollection[series].observations){
                            data.push(plotSeriesCollection[series].observations[obs].obsValue);
                        }
                         
                        var timePeriod = [];
                        for(time in plotSeriesCollection[series].observations){
                            timePeriod.push(plotSeriesCollection[series].observations[time].obsTime);
                        }
                        chartOptions.categoryAxis = {"categories": timePeriod, "labels": {"step": 60}, "baseUnit": "days", "crosshair": {"visible": true, "color": "silver"}, "type": "date", "majorTicks": {"visible": "false"}, "minorTicks": {"visible": "false"}};
                         
                         
                         
                        chartOptions.series.push({"name": name, "color": "red", "axis": "straight", "data": data, "width": 1, "missingValues": "interpolate", "markers": {"visible": false}});
                        chartOptions.navigator.categoryAxis = {"categories": timePeriod, "labels": {"step": 60}, "baseUnit": "days", "crosshair": {"visible": true, "color": "silver"}, "type": "date", "majorTicks": {"visible": "false"}, "minorTicks": {"visible": "false"}};
                         
                        chartOptions.navigator.series.push({
                            "name": name,
                             axis: "_navigator",
                             type: "area",
                            "color": "red",
                            "data": data
                        });
                    }
                     
                 
                    chart.redraw();
                }
Tonih
Top achievements
Rank 1
 answered on 09 Oct 2013
0 answers
136 views
Hi
I want to be able to get all the files from all directories at a particular location on a virtual cluster. What is the best way to do that. Following that, I also want to be able to view the data in each file in a tabular format or a histogram, such that the UI looks nice. I want to be able to use REST api's to do this.

Any ideas?

Thanks,
Kinnary
Kinnary
Top achievements
Rank 1
 asked on 09 Oct 2013
2 answers
123 views
I have created an example here. jsfiddle If you type 'z' or any invalid date and click the button the message covers the images used in the control. I tried to create a span tag to display the message but that did not work. Please help.
Todd
Top achievements
Rank 1
 answered on 09 Oct 2013
2 answers
550 views
Hi,
I m  using kendo Hierarchy  grid. In child grid I put a "edit" button. So I need to get child row first column data (ID) when I click the edit button.
 My detailInit function and clickbfunction is here.

function detailInit(e) {                       
             var    _Po_sectionID =e.data.SectionID;
                                    $("<div/>").appendTo(e.detailCell).kendoGrid({
                                        dataSource: {
                                            transport: {
                                                read: _PostionsBySectionUrl + _Po_sectionID
                                            },
                                            schema: {
                                                data: "Data",
                                                total: "Count"
                                            },                                    
                                        },
                                        scrollable: false,
                                        sortable: true,
                                        pageable: true,
                                        columns: [
                               
                                            { field: "ContainerID", title: "Possition ID",hidden:true },
                                            { field: "ContainerName", title: "ContainerName",hidden:true  },
                                            {
                                                title: "Action", width: 95, command: [
                                                          {
                                                              id: "edit",
                                                              name: "edit",
                                                              click: OnPositionRowSelect,
                                                              template: "<a class='k-button k-grid-edit' href='' style='min-width:16px;'><span class='k-icon k-edit'></span></a>"
                                                          }                                                       
                                                    ]
                                                },
                                        ]
                                    });
 } 

 function OnPositionRowSelect(e) {
                 e.preventDefault();
                 _ _ _ _ _  _ _ _ _ _   _ _ _ _ _  _ _ _ _ _  _ _ _ _ _
                 _ _ _ _ _  _ _ _ _ _   _ _ _ _ _  _ _ _ _ _  _ _ _ _ _
                _ _ _ _ _  _ _ _ _ _   _ _ _ _ _  _ _ _ _ _  _ _ _ _ _
               _ _ _ _ _  _ _ _ _ _   _ _ _ _ _  _ _ _ _ _  _ _ _ _ _
               alert("Container Id : "+ ContainerID);

 }

Regards


Håkan
Top achievements
Rank 1
 answered on 09 Oct 2013
10 answers
2.1K+ views
I have a Kendo Grid and am using MVVM.  I have my solution working for all CRUD operations more or less. One thing I was wondering is how do I manage server side validation errors in the grid when using MVVM.  For instance if I add a new record which calls a web service to save.  If the WS raises an error saying a record already exists with the same values or similar then how do I go the following:

1) Catch the error and display to the end user
2) Prevent the row from being added to the grid (I wouldn't want to copy the update to the model in this case).

The web service call will still succeed with a 200 http code however it will return a flag indicating there was a validation failure.  My data source code is like:

var paramDataSource = new kendo.data.DataSource({
            schema: {
                data: function (data) { //specify the array that contains the data
                    return data || [];
                },
                model: { // define the model of the data source. Required for validation and property types.
                    id: "PARAMETER_ID"
                },
                errors: "error"
            },
            error: function(e) {
                alert(e.errors);
                },
            pageSize: 10,
            batch: false,
            transport: {
                read:
                {   
                    url: "/UserParameter/GetData",
                    dataType: "json"
                },                
                update: {
                    url: "/UserParameter/Edit",
                    type: "POST" ,
                    dataType: 'json'
                },
                create: {
                   url: "/UserParameter/Create",
                    type: "POST" ,
                    dataType: 'json'
                }
            }
        });



// Create an observable object.
        var vm = kendo.observable({
            userParams: paramDataSource
        });

        kendo.bind($("#userParams"), vm);        
Ivan ORdoñez
Top achievements
Rank 1
 answered on 09 Oct 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
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
DropDownTree
ListBox
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
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?