Telerik Forums
Kendo UI for jQuery Forum
1 answer
109 views
Hi, I have an application which has a huge amount of data to be loaded into Kendo grid. I am using web forms(aspx). Since I need to download some thousands of rows into grid, I am trying to load the data from database by giving the page size.

I want the sort to be done for all the rows, but for my code, sorting is done only for those 2000 rows in the current view.

Can anyone please let  me know which is the good way to do serversorting and serverpaging with lot of data in the database that should be loaded into the kendo grid.

Thanks in advance!

Here is my code:
 Dim get_data As String = "select fname, lname, address, phnum from contacts limit  " & limit & ", 2000"

'limit here is taking the page numberr
          Dim JSON_result As String = "["
          'get the data from DB and make it a JSON string
 
          Dim connection1 As New MySqlConnection(constr)
          connection1.Open()
          Dim get_Command As New MySqlCommand(get_data, connection1)
          Dim reader As MySqlDataReader = get_Command.ExecuteReader()
          While reader.Read()
 
              Dim FirstName As String = reader("fname").ToString()
              Dim LastName As String = reader("lname").ToString()
              Dim address As String = reader("address").ToString()
              Dim phnum As String = reader("phnum").ToString()
             
 
              JSON_result += "{""First Name"":""" & FirstName & """, ""Last Name"":""" & LastName& """, ""Address"":""" & address & """, ""contact"":""" & phnum& """},"
          End While
          JSON_result = JSON_result.Remove(JSON_result.Length - 1)
          JSON_result += "]"

And my front end looks like:

var grid = $("#gridAllRuns").kendoGrid({
                       dataSource: {
                           type: "json",
                           transport: {
                               read: url_load
                           },
                           schema: {                               
                               total: function (response) {
                                   return 43658;
                               }
                           },
                           serverPaging: true,
                            
                           pageSize: 2000
                       },
                       dataBound: onDataBound,
                       height: $(document).height() - 250,
                       groupable: true,
                       sortable:true,
                       reorderable: true,
                       //selectable: "multiple",
                       resizable: true,
                       pageable: true,
                      
                          filterable: {
                           extra: false,
 
                           operators: {
                               string: {
                                   eq: "equal to",
                                   startswith: "starts with",
                                   neq: "not equal to"
                               }
                           }
                       },
                       toolbar: kendo.template($("#template").html()),
                       columns: [
                           { title: "First name", field: "First Name"},
                           { title: "Last name", field: "Last Name" },
                           { title: "Address", field: "Address" }]
            }



Daniel
Telerik team
 answered on 21 May 2014
1 answer
72 views
We are using Kendo UI Controls and its Validations.

Now the problem is the Kendo validations are not working in manner like MVC validations.

I want to know how to get kendo validation working like the way Classic MVC validations works.

Following is the scenario which I would like to achieve by either of ways.

--- Kendo UI Validation raise popup beneath the controls whenever validations occurs. And I don't want required field error message like tool tip or popup.

I want to have simple red border around the control (drop-down list or text box) if I m not selecting any item from drop-down list and submit the button.

So I want to avoid that popup/tooltip situation whenever validations fires.
Daniel
Telerik team
 answered on 21 May 2014
2 answers
68 views
I'm developing our first Kendo Mobile app and run into an issue with Safari in iOS7. 

When I perform a $.ajax request (see below) to verify the usercredentials, the iPhone/iPad Network Activity Indicator starts spinning and does not stop. The indicator even keeps spinning after I shutdown webpage with the Kendo app. I have to remove the websitedata via the Settings menu to stop the Indicator from spinning.

          var request = $.ajax({
            url: webapiEndpoint() + '/authenticate/login?' + urlParameters,
            type: 'GET',
            contentType: "application/json",
            data: '',
            dataType: 'json',
            processData: false
         });

         request.done(function ( data ) {
            app.navigate(activePage);
         });

         request.fail(function ( error ) {
            app.navigate(loginPage);
         });

The $ajax request receives the correct response from the WebApi and shows the appropriate page. Are you aware of any issue with iOS7 Safari that causes this strange behavior? Other $.ajax requests result in the same issue, so it is not this specific request that is causing the problem.









Remco
Top achievements
Rank 1
 answered on 21 May 2014
1 answer
240 views
Using Kendo UI Mobile, what is the best way to allow a user to specify a duration such as an hour and thirty minutes.  I would like to give them something similar to the time form input but without the AM/PM designation.  Is this possible or is there a better way?

Thanks
Kiril Nikolov
Telerik team
 answered on 21 May 2014
5 answers
194 views
Hi ,

1)
When I set the Width of AutoSelect  in below demo for State filed;  it does also changing auto search filter  on column. Can you guys please suggest a solution.
And Autoselect for State field width not looking same in all browsers. In IE9 Autoselect width looks similar to  all other fields in the form. But when we take it on Chrome "State" field looks much bigger.

2) And also can you help in validating Autoselect  for State field.I   am trying to clear the Autoselect field when non existing datavalue is typed in the State field but that is not working. Can you please help.
//create AutoComplete UI component
                      $("#State").kendoAutoComplete({
                          dataTextField: "text",
                          dataValueField: "value",
                          open: function (e) {
                              valid = false;
                          },
                          select: function (e) {
                              valid = true;
                          },
                          close: function (e) {
                              // if no valid selection - clear input
                              if (!valid) this.value('');
                          },
                          dataSource: autoCompleteStates,
                          placeholder: "Select States..."
                      });
Note: Demo doesn't have Scripts (Kendo/Js) included.

Thanks,
Chatrapathi Chennam
Petur Subev
Telerik team
 answered on 21 May 2014
1 answer
474 views
Hello,

This error is happening quite frequently across all three browsers on a ASP.NET MVC Kendo Grid we use. I attempted to wrap any javascript functions we wrote that interact with the kendo controls in document ready but it did not make any difference. Sample code is below:

@Html.HiddenFor(m => m.CustomerTypesQuery)
                @(Html.Kendo().Grid<SelectListItem>()
                        .Name("CustomerTypes")
                        .HtmlAttributes(new { style = "width: 100%; height: 165px;" })
                        .Columns(columns =>
                                        {
                                            columns.Bound(p => p.Value).Hidden();
                                            columns.Bound(p => p.Text).Title("Customers");
                                        })
                        .Scrollable()
                        .Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple))
                        .DataSource(dataSource => dataSource
                                                              .Ajax()
                                                              .Read(read => read.Action("ReadCustomerTypes", "Search"))
                                                              .Model(m => m.Id(p => p.Value))
                      )
                        .Events(events => events.Change("CustomerTypesChange").DataBound("CustomerTypesDataBound"))
                )

                <script type="text/javascript">
                    function CustomerTypesChange() {
                        var grid = $('#CustomerTypes').data('kendoGrid');
                        var rows = grid.select();
                        $('#CustomerTypesQuery').val('');
                        rows.each(
                            function () {
                                var record = grid.dataItem($(this));
                                $('#CustomerTypesQuery').val($('#CustomerTypesQuery').val() + record.Value + ",");

                            }
                        );
                        $('#CustomerTypesQuery').val($('#CustomerTypesQuery').val().replace(/,$/, ''));
                         //posts a form to the server
                         submitAjaxForm();
                    }

                    function CustomerTypesDataBound() {
                        filterHiddenFieldDataBound.call(this, 'CustomerTypesQuery');
                    }

        //wrapping any fo these interactions wit document ready does not help
        var filterHiddenFieldDataBound = function(hiddenfield) {
        var hiddenfieldId = '#' + hiddenfield;
        var grid = this;
        var dataSource = this.dataSource;
        var matchedItems = new Array();
        var value = $(hiddenfieldId).val();
        if (value) {
            $.each(value.split(','), function() {
                var item = dataSource.get(this);
                if (item) {
                    var row = grid.tbody.find('[data-uid=' + item.uid + ']');
                    row.addClass('k-state-selected');
                    matchedItems.push(this);
                }
            });
            $(hiddenfieldId).val(matchedItems.toString());
        }
    };
 </script>

I attempted to wrap functions that called the .value() method of kendo in document ready as per http://www.telerik.com/forums/cannot-call-method-%27value%27-of-kendodropdownlist-before-it-is-initialised-error#dhl__nLrG0GvjpwmSeI5PQ but this did not help
We are using kendo version 2014.1.318 but even attempting to upgrade to  2014.1.416 did not fix this issue. I know this is a kendo grid example but the error is being thrown on the kendo drop down list component of the kendo library so I thought this section would be appropriate.
Georgi Krustev
Telerik team
 answered on 21 May 2014
1 answer
386 views
Hello. 

I'm trying to add a button to upload an image in the grid. The problem is when the row is "saved". All elements of the file are stored, but the byte [] (picture) never reaches the controller.

He conseguido rellenar el grid mediante javascript





But when i try to save, the object received controller is empty in field img



@(Html.Kendo().Grid<InventarioMerlin.Models.ContadorModelo>()
    .Name("GridContadorModelo")
    .Columns(columns =>
    {
        columns.Bound(p => p.id).Visible(false).Width(100);
        columns.Bound(p => p.nombre).Width(100);
        columns.Bound(p => p.isenabled).Width(100);
        columns.Bound(p => p.img).Width(100);
        columns.Command(c => c.Custom("Upload").Click("upload")).Title("Grafica").Width(100);
        columns.Bound(p => p.grafica).Width(100);
        
        columns.Command(command => { command.Edit(); }).Width(200);
    })
                    .ToolBar(toolbar => { toolbar.Create(); toolbar.Save(); })
    .Editable(editable => editable.Mode(GridEditMode.InCell))
    .Pageable(p => p.Refresh(true))
    .Sortable()
    .Scrollable()
    .HtmlAttributes(new { style = "height:100%;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)    
        .Events(events => events
            .Error("error_handler")
            .RequestEnd("onRequestEnd"))
            .Model(model =>
                        {
                            model.Field(p => p.img).Editable(true);
                            model.Id(p => p.id);
                            model.Field(p => p.id).Editable(false);
                            model.Field(p => p.isenabled).DefaultValue(true);
                        })
            .Create(create => create.Action("ContadorModelo_Popup_Create", "Contador"))
            .Read(read => read.Action("ContadorModelo_Popup_Read", "Contador"))
            .Update(update => update.Action("ContadorModelo_Popup_Update", "Contador"))
            //.Destroy(update => update.Action("EditingPopup_Destroy", "Ccoconfiguraciones"))
    )
        )
 
 
 
function upload(e)
    {
         
        e.preventDefault();
        rowSelected = this.dataItem($(e.currentTarget).closest("tr"));
       
        $('#myModal').modal({
            show: true
        })
 
        
    }
 
 $("#btnSaveChanges").click(function () {
        refreshGrid();
        $('#myModal').modal('hide');
    });
 
 
function refreshGrid()
    {
        var grid = $("#GridContadorModelo").data("kendoGrid");
        var dataSource = grid.dataSource;
        var data = dataSource.data();
        $.each(data, function (index, rowItem) {
            if (rowItem.id == rowSelected.id) {
                rowItem.img = imageUploaded;
                rowSelected.dirty = true;
            }
        });
        grid.refresh();
         
    }


Daniel
Telerik team
 answered on 21 May 2014
1 answer
138 views
Hi
  Can you use the DropDownList on the mobile? 

 http://trykendoui.telerik.com/ICoJ

I want to use a DropDown on a site where I am using mobile controls, hence I need to include the mobile.css and js.
As you can see from the example the styling is wrong. This also applies to the Editor control. 

Do I need to include files in a specific order?

thanks


  
Kamen Bundev
Telerik team
 answered on 21 May 2014
2 answers
114 views
Hi,

I have seen this documentation about how to turn the drop zone visible. I wanted the user to know where he could drop his files so I changed the style to a div with a visible gray dashed border.
However, I would like this border to turn black whenever a file is being dragged. It will give a better feedback to the user to where he has to drop the file.

I know this is possible because in the default configuration, the drop zone is invisible and turns visible whenever a file is being dragged in the window.

So long story short, what function is triggered when dragging occurs?

Thanks for your help!

Alex
Masaab
Top achievements
Rank 1
 answered on 21 May 2014
1 answer
63 views
I would like to use a TabStrip to break up the fields in a popup edit form from the Scheduler widget. Will this work?

So far my test of putting the Basic TabStrip samples <div id="forecast">...</div> into a working edit template throws a content error.

Roderick Prince
Top achievements
Rank 1
 answered on 20 May 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
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
Bronze
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
Bronze
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?