Telerik Forums
Kendo UI for jQuery Forum
0 answers
141 views

Dears,

I have issue that offline feature not update grid column with dropdownlist

non-dropdownlist is working but I have e.g category and product in my grid when update it shows old value

 

after update when click edit again it shows the update value 

 

please help

Thanks

jas
Top achievements
Rank 1
 asked on 12 Jan 2022
1 answer
160 views

In previous version of kendo UI 2017 R3, kendo grid was sending separate instances of row when expanding multiple rows together. But, in latest version Kendo UI 2021 R3, it is sending all the instances together, due to which DetailInit method is repeating the rows.

 

Steps:

Copy paste the below code in kendo dojo

Select old version 2017 R3 and run.

Then change the version to 2021 R3 then run.

 

kendo Dojo Code:

<script>
  (function onDojoReady(global, $, kendo){
      
      function InitChildGrid(e){
              var row = e.detailRow;
        
        var jGrid = $("<div />", { "class": kendo.format("grey-detail-row js-grey-detail-row_{0}_{1}", e.data.ID, e.data.FirstName) });
        
        var dataSource = [
          {
          ID: e.data.ID,
            FirstName: e.data.FirstName,
            LastName: e.data.LastName
          }
        ];
        
        
        // This should be only shown in Adarsh.
        if(e.data.ID == 1){
        dataSource.push({
          ID: 4,
            FirstName: "hello",
            LastName: "world"
          });
        }
        
        if(e.data.ID == 2){
        dataSource.push({
          ID: 5,
            FirstName: "Super",
            LastName: "Duper"
          });
        }
        
        jGrid.appendTo(e.detailCell).kendoGrid({
        scrollable: false,
          //sortable: true,
          //pageable: true,
          //groupable: false,
          //selectable: 'row',
          dataSource: dataSource, 
          columns: [
            { field: "ID" },
            { field: "FirstName" },
            { field: "LastName" }
          ]
        }).data("kendoGrid");
      }
      
      function InitParentGrid(){
      var dataSource = [
          {
          ID: 1,
            FirstName: "Adarsh",
            LastName: "Choudhary"
          },
          {
          ID: 2,
            FirstName: "Shashwat",
            LastName: "Singh"
          },
          {
          ID: 3,
            FirstName: "Omkar",
            LastName: "Gokale"
          }
        ];
        
        var jGrid = $("#ParentGrid");
        var kGrid = jGrid.kendoGrid({
          dataSource: dataSource,
          dataBound: function(){
          this.expandRow(this.tbody.find("tr.k-master-row"));
          },
          detailInit: InitChildGrid,
        scrollable: false,
          selectable: 'row',
          columns: [
            { field: "ID" },
            { field: "FirstName" },
            { field: "LastName" }
          ]
        }).data("kendoGrid");
        
      }
    
      $(document).ready(function(){
      InitParentGrid();
      });
      
    })(window, jQuery, kendo);
  </script>
  
  <div id="ParentGrid"></div>

Output in old version:

Output in latest version:

Georgi Denchev
Telerik team
 answered on 12 Jan 2022
2 answers
381 views

Hello, 

I have a question about grids loading: some customers could receive the fully loaded content on the UI, while some received a different loaded content for the same JSP code. Here are how the loaded HTML using the same code look like in the browser for two different customers: 

for one customer:

<div id="transportGrid">
    <div class="k-header k-grid-toolbar ">...</div>
    <table role="grid" tabindex="0" data-role="selectable" class="k-selectable" style aria-activedescendant="transportGrid_active_cell">...</table>
    <div class="k-pager-wrap k-grid-pager k-widget k-floatwrap userDefinedBgColor" data-role="pager">...</div>
    <div class="k-resize-handle">...</div>
</div>

 

for the second customer:

<div id="transportGrid">
     <div class="k-header k-grid-toolbar">...</div>
     <div class="k-grid-header" style="padding-right: 17px;">...</div>
     <div class="k-grid-content k-auto-scrollable userDefinedBgColor">...</div>
     <div class="k-pager-wrap k-grid-pager k-widget k-floatwrap userDefinedBgColor" data-role="pager">...</div>
</div>

so for the first customer, the <divs> containing the k-grid-header and k-grid-content are ignored and replaced by <table> element. 

Do you know the reason of the difference of the loaded contents?

Thanks in advance for your help and answer.

Best regards,

Antsa Rakotoarimalala

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 11 Jan 2022
1 answer
139 views

When opening the viewHtml window from the Editor widget, I want to bind to that window's open event and access the KendoWindow instance so that I can update the options for the window using the setOptions method.

How do I do this?

Any tips are appreciated.

 

Thanks!

Martin
Telerik team
 answered on 11 Jan 2022
1 answer
150 views

Hi,

Is it possible to remove or hide the space that is highlighted in green on the attached screenshot?

I want to make it look like this below:

This is for the Spreadsheet widget.

Thanks!

Neli
Telerik team
 answered on 11 Jan 2022
1 answer
131 views

Hi guys,

I'm able to perform cell validation by providing a list of acceptable values. This provides the user with a dropdown to select a suitable value. This is great, but I need to extend it so that it is mandatory when the value in another cell is provided, but must be blank if the other cell is not populated. For example:

  • Cell A1 can take any value, including blank
  • When cell A1 is blank, cell B1 must be blank
  • When cell A1 is not blank, cell B1 must be populated from its dropdown list

Is it possible to achieve this?

Neli
Telerik team
 answered on 11 Jan 2022
1 answer
355 views

Hello Team, 

I have a following scenario.

<script id="OuterTemplate" type="text/x-kendo-template">

# for (var i = 0; i < data.length; i++) { #     

<a href="\\#'" data-bind="click: onOuterLinkClick" data-index="#: i #">#: data[i].displayText #</a>

#}#

     #= renderMyTemp(data[i].innerLinks) #

</script>

<script id="InnerTemplate" type="text/x-kendo-template">

# for (var j = 0; j < data.length; j++) { #

    <a href="\\#" data-bind="click: onInnerLinkClick"
       data-index="#: j #">#: data[j].displayText #</a>
    # } #

</script>

<script type="text/javascript" >
    function renderMyTemp(data) {
        return kendo.Template.compile($('#InnerTemplate').html())(data);
    }
</script>

 

And my data which is getting passed to OuterTemplate, looks like following:

var data = [
  {
    "displayText" : "outer link abc",
    "onOuterLinkClick" : () => {},
    "innerLinks" : [
        {
          "displayText" : "inner link abc1",
          "onInnerLinkClick" : () => {}      
        },
        {
          "displayText" : "inner link abc2",
          "onInnerLinkClick" : () => {}
        }
      ]
  },
  {
    "displayText" : "outer link def",
    "onOuterLinkClick" : () => {},
    "innerLinks" : [
        {
          "displayText" : "inner link def1",
          "onInnerLinkClick" : () => {}      
        },
        {
          "displayText" : "inner link def2",
          "onInnerLinkClick" : () => {}
        }
      ]
  }

]

I pass the data as follows: 

var template = kendo.template($('#OuterTemplate').html());

template(data);

 

Question : In above code, inside outerTemplate, onOuterLinkClick binding is working properly. But inside InnerTemplate, onInnerLinkClick binding is not working. can you please tell me, what's the correct way to do it?

Thanks & Rergards

Karan

Martin
Telerik team
 answered on 11 Jan 2022
2 answers
1.4K+ views

Hi,

 

I'm using client-side filtering after the kendo grid is rendered and I wanted to export to excel the filtered data in some situations.

I tried using $("#reportResultsGrid").data("kendoGrid").dataSource.view() and that gives me the current object of what I want to export to excel, but I can't figure out how to use the saveAsExcel() method to export what's in that current view() in the kendo grid. I can console log it, but I just can't figure out how to export the filtered data. 

 

My goal originally was to create a custom button in excel toolbar and use that to export the data but, now I'm just using a stand alone button at the top of the page for testing purposes. Ideally I would like to create a button in the excel toolbar that just exports whatever is in the current kendo grid view.

Below is as far as I've figured out.

 $('#testSaver').on("click", function () {
    $("#reportResultsGrid").data("kendoGrid").dataSource.view()
    console.log(clientSideFilterData);

});

Nikolay
Telerik team
 answered on 11 Jan 2022
1 answer
427 views

Hi,

In our application users can upload an excel file, this data is then displayed in a Kendo spreadsheet (JQuery) control. The templates we use to insert the data have 6 blank rows at the top:

Row 7 is the header row and the data starts at row 8.

Using the built in 'Export' function on the Kendo spreadsheet we are able to export the data. What we want to be able to do is export the data in the same format it was imported. i.e. with the 6 blank rows at the top and the header row on row 7.

I have played around with sheet.insertRow(0); but this leaves 0's in the numeric columns and also blanks out the header row.

Do you have any other suggestions?

Thanks

Ian

Dimitar
Telerik team
 answered on 10 Jan 2022
4 answers
15.7K+ views

I am trying to use Kendo Grid in a view.

In the main index.html I have reference for the required css and js files:

<link href="kendo-phcc/styles/kendo.mobile.all.min.css" rel="stylesheet">
<script src="kendo-phcc/js/jquery.min.js"></script>
<script src="kendo-phcc/js/kendo.mobile.min.js"></script>

I have a list view in the main index.html and each list item refers to a separate external view which is defined in it's own html file.

In the view html file I have this :

<div data-role="view" data-init="initGrid" data-title="Restaurants" id="restaurantsView">
            <div id="grid"></div>
</div>
 
<script>
    function initGrid() {
        //This alert was displayed
        alert("Dummy");
         
                $("#grid").kendoGrid({
                    columns: [{
                        field: "Attribute",
                        title: "Attribute"
                    },
                    {
                        field: "Value",
                        title: "Value"
                    }],
                    dataSource: {
                        data: [{
                            Attribute: "Mall/Location",
                            Value: "City Center/The Mall/Pearl"
                        },
                        {
                            Attribute: "ShopName",
                            Value: "Gold Gourmet"
                        }]
                    }
                });
            };
 
        </script>

I have seen this forum and made sure that I made no such mistakes such as repeating jquery reference or not including required files.

StackOverflow-Reference

http://stackoverflow.com/questions/32917273/uncaught-typeerror-kendogrid-is-not-a-function

But still I have the error

Could you please help me out in this problem.

The app was created from Telerik Platform so it already had the required css and js files included.

I also tried creating a separate folder and manually adding all the required files from the Kendo UI Professional zip that I downloaded from my account.

But still I have the same issue.

I think this is a very basic question but I am just starting with kendo and Telerik so I would really appreciate your help

Salama
Top achievements
Rank 1
Iron
Iron
 answered on 07 Jan 2022
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?