Telerik Forums
Kendo UI for Vue Forum
100 questions
Sort by
3 answers
362 views

I recently ran into a situation where an update method I wrote stopped working.  The method uses jQuery to open a grid row, target 4 separate fields and change their values to new ones that have come in from an API call.

When I dug in, I discovered that the attribute my method uses to navigate to each field in the row, data-field="myFieldName", was completely missing.  Thus the jQuery was finding nothing and no updates were happening.

The field is in all my other grids so I looked to see what I had done differently in this grid to make that disappear.  Turns out a couple things: One was I added "editable" and "navigatable" as options to the grid, because I'm allowing in-cell editing.  The other was I set "scrollable" to true (I typically set it to { virtual:true }).

As soon as I did this the "data-field" attribute stops being rendered in the columns.  With "editable" and "navigatable" what I get instead is an attribute "aria-describedby=" with a cell-specific GUID.  The "scrollable" property seems to just eliminate the data-field but has no other weird effects.

I need in-cell editing but I also need to have each field position identified.  Is there a way I can force "data-field" to show up?  Alternatively I could add a new "data-customAttribute" type of attr on there, but how do I accomplish that?  Worst case I can add an identifier into the actual template for the column, which is just some simple HTML. 

I'd prefer to do it with "data-field" since that would allow me to implement one consistent method for editing values whether a grid is marked as editable or not.

Plamen
Telerik team
 answered on 03 Mar 2020
2 answers
3.5K+ views

I have a column like this:

 

<kendo-grid-column :command="[{name: 'open', click: open}]"></kendo-grid-column>

 

It works fine, but I want it to show a bootstrap glyphicon and no text instead of the text "open" that is showing now.

Is there any way to template the column so that I can get the click event and also use any content I want inside the column?

Thanks in advance.

 

Plamen
Telerik team
 answered on 05 Oct 2020
3 answers
384 views

Hallo,

I am trying to include a custom toolbar into the vue template.

<template>
  <div class="page">
    <h1>Author</h1>
    <client-only>
      <kendo-datasource ref="ds"
          :schema-model-id="'id'"
          :schema-model-fields="model"
          :schema-data="schema"

          :transport-create-beforeSend="onBeforeSend"
          :transport-create-url="'http://192.168.1.11:8000/graphql'"
          :transport-create-content-type="'application/json'"
          :transport-create-type="'POST'"
          :transport-create-data="additionalParamsOnCreate"

          :transport-read-beforeSend="onBeforeSend"
          :transport-read-url="'http://192.168.1.11:8000/graphql'"
          :transport-read-content-type="'application/json'"
          :transport-read-type="'POST'"
          :transport-read-data="additionalParamsOnRead"

          :transport-update-beforeSend="onBeforeSend"
          :transport-update-url="'http://192.168.1.11:8000/graphql'"
          :transport-update-content-type="'application/json'"
          :transport-update-type="'POST'"
          :transport-update-data="additionalParamsOnUpdate"

          :transport-destroy-beforeSend="onBeforeSend"
          :transport-destroy-url="'http://192.168.1.11:8000/graphql'"
          :transport-destroy-content-type="'application/json'"
          :transport-destroy-type="'POST'"
          :transport-destroy-data="additionalParamsOnDestroy"

          :page-size="20"
          :transport-parameter-map="parameterMap">
      </kendo-datasource>
      <kendo-grid ref ="mainGrid"
                  :data-source-ref="'ds'"
                  :edit-field="'inEdit'"
                  :navigatable="true"
                  :pageable="true"
                  :editable="true">
          <!-- first try -->
          <!--
          :toolbar="["create"]"
          -->
          <!-- second try -->
          <!--   
          <GridToolbar class="k-header k-grid-toolbar">
            <button href="#" title="Add new" class="k-button k-button-icontext k-grid-add" @click="insert">
              Add new
            </button>
          </GridToolbar>
          -->
          <!-- third try -->
          <div class="k-header k-grid-toolbar">
            <a role="button" class="k-button k-button-icontext k-grid-add" href="#"><span class="k-icon k-i-plus" @click="testClick"></span> Command</a>
          </div>

          <kendo-grid-column :field="'id'"
                             :title="'ID'"
                             :width="80">
          </kendo-grid-column>
          <kendo-grid-column :field="'firstName'"
                             :title="'firstName'"
                             :width="80">
          </kendo-grid-column>
          <kendo-grid-column :field="'lastName'"
                             :title="'lastName'"
                             :width="80">
          </kendo-grid-column>
      </kendo-grid>
    </client-only>
    <kendo-notification ref="popupNotification"
        @show="onShow"
        @hide="onHide">
    </kendo-notification>

  </div>
</template>
<script>
import { Button } from '@progress/kendo-buttons-vue-wrapper';
import { Grid, GridColumn } from '@progress/kendo-grid-vue-wrapper';
import { KendoDataSource } from '@progress/kendo-datasource-vue-wrapper';
import { Notification } from '@progress/kendo-popups-vue-wrapper';
import { READ_AUTHORS_QUERY, ADD_AUTHOR_QUERY, UPDATE_AUTHOR_QUERY,DELETE_AUTHOR_QUERY } from '../graphql/author'
export default { 
  name: 'App',
  components: {
    'k-button': Button,
    'kendo-grid': Grid,
    'kendo-grid-column': GridColumn,
    'kendo-notification': Notification,
  },
  created: function() {
    console.log('created');

  },
  mounted: function() {
    console.log('mounted');
    this.popupNotificationWidget = this.$refs.popupNotification.kendoWidget();
    console.log('mounted2');
  },
  methods: {
    insert: function() {
      this.popupNotificationWidget.show('insert');
    },
    onClick: function (ev) {
        console.log("Button clicked!");
    },
    testClick: function (ev) {
        this.popupNotificationWidget.show('testClick');
        console.log("test clicked!");
    },
    onShow: function (e) {
      console.log("Show")
    },
    onHide: function (e) {
      console.log("Hide")
    },
    onBeforeSend: function(req) {
      let component = this;
      // req.setRequestHeader("Authorization", "bearer ...tokenstring...");
    },
    additionalParamsOnCreate: function(model) {
      return {
        query: ADD_AUTHOR_QUERY,
        variables: {author: model } 
      };
    },
    additionalParamsOnRead: function(model){
      console.log('additionalParamsOnRead')

      return {
        query: READ_AUTHORS_QUERY,
      };
    },
    additionalParamsOnUpdate: function(model){
        return {
        query: UPDATE_AUTHOR_QUERY,
        variables: {author: model }
      };    
    },
    additionalParamsOnDestroy: function(model){
      return {
        query: DELETE_AUTHOR_QUERY,
        variables: {author: model } 
      };
    },
    parameterMap: function(options, operation) {
      return  kendo.stringify({
        query: options.query,
        variables: options.variables
      });
    },
    schema: function (response) {
      var data = response.data;
      if (data.authors) {
        return data.authors;
      } else if (data.AddAuthor) {
        return data.AddAuthor;
      } else if (data.UpdateAuthor) {
        return data.UpdateAuthor;
      } else if (data.DeleteAuthor) {
        return data.DeleteAuthor;
      }
    },
  },

  data: function() {
    return {
      model: {
        id: "id",
        fields: {
          id: { editable: false, nullable: true },
          firstName: { type: "string" },
          lastName: { type: "string" }
        }
      }
    }
  }
}
</script>
<style>
</style>
The fist try with built-in function works: a new empty record ist displayed in first lineof the grid.

The second and third try call the methods, but no new empty record is generated.

I cannot get this to work - is this possible?

Regards,

Michael

Petar
Telerik team
 answered on 18 Nov 2020
1 answer
419 views

I am currently trying out Kendo as a proof-of-concept for a component library solution; however, I am having trouble getting any sort of styling to work.

 

Using an import statement in my App.vue file and/or including the theme stylesheet in my HTML file seems to cause some strange issues.

It seems that the default themes for the grid(not sure where they are coming from) are overriding the themes that come from Kendo. An example of this is below. The <th> element being created by the Vue Grid tag is shown below:

 

<th colspan="1" rowspan="1" class="k-header" style="position: sticky; left: 0px; right: 0px; z-index: 1; background: rgb(246, 246, 246);"></th>

 

Is there any way I can ensure that styles are not put on the HTML elements by default? I am not adding these styles to the elements anywhere in my code, so I am not sure how to get rid of them or how to have the kendo theme override them.

 

The theme that I am trying to use was created using the vue-ui theme builder. I know that the theme is being used by the application because the grid has some of the theme styling, but some portions of it are being overridden.

 

The example that I followed to create my grid is below:

https://www.telerik.com/kendo-vue-ui/components/grid-native/custom-rendering/hierarchy/

 

 

Veselin Tsvetanov
Telerik team
 answered on 05 Apr 2019
8 answers
103 views

Hi There, I have a kendo UI chart who's datasource is bound to a computed property. I can see the datasource computed property is being updated but the chart is not rebinding/redrawing. Do I need to manually redraw the chart?

If we don't need to manually refresh/redraw then do you have any ideas as to why the chart wouldn't redraw when I update the datasource prop? Thanks!

Ianko
Telerik team
 answered on 03 Oct 2018
2 answers
121 views

Plea for help:  Our front end guy left, and I've inherited his work :(   I like the JS stuff, but I'm no expert.

Our new app has about a 4 megabyte app.js download, even when minified.  We've turned on gzip compression on the server, and that gets it down to a bit over a meg, but we had a $1000 bandwidth overage last month!

I've been tasked with seeing if we are including unused code. 

So, my question:  In the docs I see this: 

// As an alternative, you could import only the scripts that are used by the utility:
// import '@progress/kendo-ui/js/kendo.data' // Imports only the DataSource script and its dependencies
 
import '@progress/kendo-theme-default/dist/all.css'
 
import { DataSource,
        HierarchicalDataSource,
        GanttDataSource,
        GanttDependencyDataSource,
        PivotDataSource,
        SchedulerDataSource,
        TreeListDataSource,
        DataSourceInstaller } from '@progress/kendo-datasource-vue-wrapper'
 
Vue.use(DataSourceInstaller)
 
new Vue({
   el: '#app',
   components: {
       DataSource,
        HierarchicalDataSource,
        GanttDataSource,
        GanttDependencyDataSource,
        PivotDataSource,
        SchedulerDataSource,
        TreeListDataSource,
        DatasourceInstaller
   }
})

 

I've got about six of these:  layout, dateinputs, inputs, dropdowns, dialog, etc.  

If I can identify which of the features I need from each I need from each "wrapper", can I cut this down?  For instance, I'm sure we don't use gantt charts or pivots above.

Thanks, 

Ed Greenberg

Ed
Top achievements
Rank 1
 answered on 13 Mar 2020
8 answers
350 views

Is it possible to access a method that was created in the Vue.JS methods with the Telerik grid, in this case a click action?

template: "<div><button @click='showClient(#:id#)'>Show Client</button></div>"

methods: {

     showClient (id) {

           console.log(id)

          this.$router.push('/client/:id')

     }

}

output render in HTML

<td role="gridcell"><div><button @click="showClient(720)">Show Client</button></div></td>

Plamen
Telerik team
 answered on 02 May 2018
2 answers
538 views

I'm trying to have the Kendo DropDownList wrapper component expand to the viewport height so that there's a maximum amount of items on screen without having a scrollbar on <body>

 

I'm currently trying it with this approach but I'm wondering if there's a better way:

1seoqu (forked) - StackBlitz

 

The main downside of this approach is that it relies on setting the 'height' prop to a number that is larger than the data source would take up when fully rendered.  In this case a height of 999px won't work, while a height of 9999px will work. So when I set the height to 9999px I get the desired result but it feels hacky and I'm wondering if there's a better way.

Filembar
Top achievements
Rank 1
Iron
Iron
 answered on 04 Feb 2022
8 answers
621 views

I'm really struggling here. I need to add a custom button which takes the ID of the current row. I've tried added a columns array and adding a "template" entry, to no luck and now trying to do this inline. Any help?

 

{field: 'name', title: 'District Name', width: '250px'},
{
width: '70px',
template: '<button class="btn btn-sm btn-info" v-on:click="alert(# _id #)">Edit</button>'
},

<kendo-grid id="grid"
:data-source-ref="'dataSource'"
class="table table-sm">
<kendo-grid-column :field="'name'" :title="'District Name'"></kendo-grid-column>
<kendo-grid-column :field="_id">
<button class="btn btn-sm btn-info" v-on:click="openManager(_id)">Manager</button>
</kendo-grid-column>
</kendo-grid>

Sam
Top achievements
Rank 1
 answered on 24 Aug 2018
Narrow your results
Selected tags
Tags
Grid
General Discussions
DropDownList
Grid wrapper
Editor
DatePicker
DropDownTree wrapper
Scheduler
Spreadsheet wrapper
Input
Editor wrapper
MultiSelect
DateInput
NumericTextBox
Scheduler wrapper
Styling / Themes
Calendar
DataSource wrappers (package)
Chart
Chart wrappers (package)
DateTimePicker
Gantt wrapper
Localization
Pager
Checkbox
Upload
DropDownList wrapper
Window
Form
Tooltip
TreeView
ComboBox
Dialog
MultiSelect wrapper
NumericTextBox wrapper
Popup
Slider
Toolbar wrapper
Upload wrapper
Validator wrapper
Error
ColorPicker
Accessibility
AutoComplete
AutoComplete wrapper
Button wrapper
ComboBox wrapper
ContextMenu wrapper
Licensing
ListBox wrapper
ListView wrapper
Map wrapper
MaskedTextBox
Menu wrapper
MultiColumnComboBox wrapper
Splitter wrapper
TabStrip wrapper
TimePicker
TreeView wrapper
TabStrip
Card
FloatingLabel
TextArea
Drawer
Stepper
Gauge
Splitter
PanelBar
Notification
RangeSlider
Menu
TreeList
Toolbar
ListView
FontIcon
SVGIcon
Animation
Barcode wrapper
ButtonGroup wrapper
Chat wrapper
ColorPicker wrapper
DateInput wrappers (package)
Diagram wrapper
Dialog wrapper
Gauges wrappers (package)
MaskedTextBox wrapper
MediaPlayer wrapper
Notification wrapper
Pager wrapper
PanelBar wrapper
PivotGrid wrapper
QRCode wrapper
RangeSlider wrapper
ScrollView wrapper
Security
Slider wrapper
Switch wrapper
Tooltip wrapper
TreeList wrapper
TreeMap wrapper
Window wrapper
Avatar
StockChart
Sparkline
RadioButton
RadioGroup
Hint
Loader
ProgressBar
DateRangePicker
Switch
Wizard
Skeleton
ScrollView
ColorGradient
ColorPalette
FlatColorPicker
Button
ButtonGroup
TileLayout
ListBox
ExpansionPanel
BottomNavigation
AppBar
Signature
ChunkProgressBar
VS Code Extension
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?