Telerik Forums
Kendo UI for jQuery Forum
1 answer
74 views

In the demo here : http://demos.telerik.com/kendo-ui/grid/virtualization-remote-data and in other tests I have done in my app, it seems that the request to load data from the remote datasource is done two times (or sometimes just one time as expected).

The problem with this behavior is that my app has to perform a big query in the database two times instead of one, which is bad for performance.

Is there any reason why this is done this way or is this a bug ?

I have tested on OSX with Safari, Firefox Dev and Opera Dev.

Thanks for your help.

Dimo
Telerik team
 answered on 22 May 2015
1 answer
1.9K+ views

Hi,

One of the columns is an ID of a record. Id has a certain format something like: XXXX-XXX-1 etc.

 When sorting on this column values show as:

XXXX-XXX-1

XXXX-XXX-10

XXXX-XXX-2

XXXX-XXX-3

...

 

Is there a way to properly sort such that -10 appears after?

 

Thanks

Plamen Lazarov
Telerik team
 answered on 21 May 2015
8 answers
2.1K+ views
Lets say I have a grid:

var release_grid = $("#release_grid").kendoGrid({
  dataSource: dataSource,
  pageable: false,
  sortable: true,
  columns: [
    { field: 'primary', title: 'Primary?', width: '78px' },
    { field: 'iso_3166_1', title: "Country", width: '320px', editor: countryDropDownEditor, template: kendo.template($("#country_template").html()) },
    { field: 'release', title: "Release Date", format: '{0:yyyy-MM-dd}', width: '105px' },
    { field: 'certification', title: 'Certification', width: '105px', editor: certificationDropDownEditor, template: '#=certification#' },
    { command: [
      { name: "edit", text: { edit: "Save", update: "Save",  cancel: "Cancel" }, template: kendo.template($("#edit_template").html()) },
      { name: "destroy", template: kendo.template($("#delete_template").html()) }
    ], title: 'Edit' }],
  editable: {
    mode: 'popup',
    confirmation: 'Are you sure you want to delete this record?'
  }
});
Now for the 'certification' field, I would like it to do an AJAX call with the selected value from the 'iso_3166_1' value. How do I do this?

function certificationDropDownEditor(container, options) {
  $('<input data-text-field="certification" data-value-field="certification" data-bind="value:' + options.field + '"/>').appendTo(container).kendoDropDownList({
    autoBind: false,
    dataSource: {
      type: "json",
      transport: {
        read: '/country/certifications'
      }
    }
  });
}
I cannot figure out how to pull the selected row's 'iso_3611_1' value out to use in this AJAX call. Anyone got any pointers?
Boyan Dimitrov
Telerik team
 answered on 21 May 2015
2 answers
137 views

Hi all , I need some help with some issues in a custom editor I add to a kendo grid . I'm using MCV and the code is the following : 

   @(Html.Kendo().Grid<GridProspectObject>()    
       .Name("GridAllProspects")
       .AutoBind(false) 
        Events(events =>
         {
               events.DataBound("loadtooltipsAllProspectsGrid");
               events.Edit("onEditAssignment");
          })
          .Columns(columns => 
          {
                  columns.Bound(p => p.ProspectName).Title("name");

                  columns.Bound(p => p.Class).Title("class");

                   columns.Bound(p => p.DisplayStatus).Title("assignment status (click to change)").ClientTemplate("#=AssignedTo#").EditorTemplateName("EditorVolunteer").HtmlAttributes(new { @style = "text-align:left" });
          })
         .ToolBar(toolbar => 
        {
               toolbar.Save();        
         })
         .Editable(editable => editable.Mode(GridEditMode.InCell))
         .Pageable()
         .Sortable()
          .Filterable()
         .DataSource(dataSource => dataSource        
             .Ajax()         
             .Batch(true)
            . PageSize(50)
            .Model(model =>
            {
               model.Id(p => p.ProspectId);
               model.Field(p => p.ProspectName).Editable(false);
              model.Field(p => p.Class).Editable(false);
           })
          .Read(read => read.Action("Read_AllProspects", "Projects", new { listId = prospectList.PROSPECT_LIST_ID, pid = Model.PROJECTS_ID }).Type(HttpVerbs.Get))
.          Update(update => update.Action("ChangeAssignment", "Projects"))
         )
        .HtmlAttributes(new { @style = "margin-top:10px" })
   )

The editor template is a kendo comboBox : 

      @(Html.Kendo().ComboBox()
        .Name(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))
        .Filter("contains")
        .Placeholder("--select--")
        .DataValueField("Value")
        .DataTextField("Name")
        .Events( events =>
        {
            events.DataBound("dataBound");
            events.Open("openDropDown");
        })
        .DataSource(dataSource => dataSource
            .Read(read => read.Action("ReadAsignmentOptions", "Projects").Data("getParentId") )
        )
        .Template("#if( data.Value == '" + Guid.Empty + "' || data.Value == '-1' ) {# " +
            "<span class='specialOption'>#:data.Name #</span>" +
            " #} else {# " +
            "<span>#:data.Name#</span>" +
            " #}#")
     )


Finally the "getParentId()" function is : 

  function getParentId() {
        var row = $(event.srcElement).closest("tr");
        var grid = $(event.srcElement).closest("[data-role=grid]").data("kendoGrid");
        var dataItem = grid.dataItem(row);
        return { prospectId: dataItem.ProspectId, currentAssigned: dataItem.AssignedToId };
    }

The issues I need help with are : 

 

 1) I want to add server filtering to the combobox so I can display a custom message "no results to display" when the text entered in the comboxbox returns no results but when I add the options "ServerFilter(true)" to the comboxbox the function getParentId() throws an error saying "cannot ready property dataItem of null".

 2) When a selection is made from the combobox (the same custom editor) , I want to display that selection with the red corner in the cell visible, so the user can see the change before saving . Right now when I select an option the old value keeps showing in the grid cell and only red icon appears. 

 3) This code works fine in IE  and Google Chrome , but for some reason it does not work in Firefox. When I click on the grid cell to edit it the combobox just spins forever because the request never gets to the controller. Is this a known bug ? 

 

Thanks !

 

 

Boyan Dimitrov
Telerik team
 answered on 21 May 2015
1 answer
163 views

When a row on a grid is clicked a popup form is opened. Inside the form I setup a Razor Kendo DropDownList from a database. I was able to mange the DropDownList to change HTML tables based on the drop down value. However, when the form is initially loaded I am not able to show the correct table in other words i am not able to get the value of the current displayed item. 

This is how I change tables when the user select different item in the menu:

    $(function () {
            $('#PaymentType_ID').change(function () {
                $('.payment').hide();
                if ($(this).val() == "5") {
                    $('.payment').hide();                    
                }

                if ($(this).val() == "2") {
                    $('#creditCardPayment').show();
                    $('#generalPayment').show();
                }

                if ($(this).val() == "1" || $(this).val() == "3" || $(this).val() == "4") {
                    $('#otherPayment').show();
                    $('#generalPayment').show();
                }
            });
        });

 

I want to reuse most of the code but instead of using on .change I want to use something like .ready but it does not work.

Anyone has any idea how should I try?

Victor
Top achievements
Rank 1
 answered on 21 May 2015
1 answer
63 views

I am not sure if this has been asked already. If yes, please point me to that thread. 

Use case: This happens when a row template is implemented in Grid. If the content of cell is edited and tab key is pressed, the focus jumps to next item. But the edited cell still maintains the editor.

Expected Behavior : As soon as tab is pressed and focus get shifted out of the edited cell, the cell should display in "normal" mode rather than edit mode.

Refer to this link for my implementation

http://dojo.telerik.com/@kamit1983/IREku/11

Thanks

Boyan Dimitrov
Telerik team
 answered on 21 May 2015
1 answer
678 views

Hi,

 I have a form with validations setup and everything works fine if user tries to enter something. If user directly clicks on the submit button after page load with out touching any field then validations wont fire.

 Take a look at the example here http://dojo.telerik.com/AXIsI/2

if you just go into the text box and tab out, then error message is displayed. if you directly click on the button with out touching then validation message is not displayed as the rules is skipped based on input name checking. How can make this work?

 I made the example to be simple, in real scenario there is so much complex logic involved. So I cannot avoid using check on name and also I cannot use just the html5 "required" attribute

Daniel
Telerik team
 answered on 21 May 2015
1 answer
582 views
Hello!

We have problem with "Upload" component.

It's looks like event "OnSuccess" on it (on Upload component) does not work.

We use asynchronous upload, and  Upload component is routed to web api controller method in which we process upload.

When everything went ok with upload we set response status code [OK] (200) and we also trying to sent some data as Content back to client.

Our server-side code (in method in ASP.NET Web API controller in which we process upload from Upload component) looks like:

HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
response.Content = new StringContent("File was succesfuly uploaded");    
response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/plain");
return response;

When we try do things this way, then Upload component on client-side activates OnError event instead of OnSuccess event. 

Why is that? And is there some workaround for this?


thanks,
Igor.

Dimiter Madjarov
Telerik team
 answered on 21 May 2015
5 answers
1.2K+ views
In kendo scheduler in week/month view when an appointment is created that has two day time span and if the scheduler has some default scroll.
Then if i want to select the appointment by clicking on that the scroll is happening to point to second day.Is there any way to avoid this.
 I want to handle the appoinrment click event.
Thanks in Advance
Dimo
Telerik team
 answered on 21 May 2015
1 answer
261 views

Hi,

Does the Upload control allow setting a minimum file size so that files below this limit won't be uploaded?

 

Thanks

Dimiter Madjarov
Telerik team
 answered on 21 May 2015
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
Drag and Drop
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?