Telerik Forums
Kendo UI for Angular Forum
1 answer
377 views

I'm getting an Uncaught TypeError: Cannot read property 'width' of undefined

When moving the mouse over the dashed line. I doesn't seem to be fatal though...

 

interface Model {
    interval: string;
    count: number;
    color: string;
}
@Component({
    selector: 'app-chart6',
    template: `
    <kendo-chart>
        <kendo-chart-axis-defaults [majorGridLines]="{ visible: false }"></kendo-chart-axis-defaults>   
        <kendo-chart-series>
            <kendo-chart-series-item type="column" [data]="seriesData" [color]="color" field="count" categoryField="interval"></kendo-chart-series-item>
            <kendo-chart-series-item type="line" [data]="lineData" dashType="longDash" markers="{ visible: false }" color="#000000"></kendo-chart-series-item>
        </kendo-chart-series>
    </kendo-chart>
    `
})
export class Chart6Component {
    public lineData: number[] = [150, 150, 150];
    public seriesData: Model[] = [{
        interval: "10",
        count: 200,
        color: "#00FF00"
    }, {
        interval: "11",
        count: 250,
        color: "#0000FF"
    }, {
        interval: "12",
        count: 150,
        color: "#00FFFF"
    }];
}

 

 

Uncaught TypeError: Cannot read property 'width' of undefined
    at LinePoint.createHighlight (line-point.js:196)
    at LinePoint.toggleHighlight (chart-element.js:270)
    at Highlight.togglePointHighlight (highlight.js:51)
    at Highlight.show (highlight.js:27)
    at Chart._startHover (chart.js:1039)
    at Chart._mouseover (chart.js:1052)
    at Surface.trigger (observable.js:94)
    at HTMLDivElement.eval (surface.js:135)
    at ZoneDelegate.invokeTask (zone.js:421)
    at Zone.runTask (zone.js:188)

 

Daniel
Telerik team
 answered on 27 Mar 2018
9 answers
5.3K+ views

In API document, filter is configured with [filter] attribute.However, it does not work in the way that I thnik.

You can see my test code in https://plnkr.co/edit/byxbUXjzTjslnL2gCCSV

 

In summay, I put the filterDescriptor in [filter] attrbitue.

  <kendo-grid
        [data]="gridData"
        [filter]="filter"
  >
    <kendo-grid-column field="ProductID" title="ID" width="40" [filterable]="false">
    </kendo-grid-column>
    <kendo-grid-column field="ProductName" title="Product Name" width="100">
    </kendo-grid-column>
    <kendo-grid-column field="FirstOrderedOn" title="First Ordered On" width="240" filter="date" format="{0:d}">
    </kendo-grid-column>
    <kendo-grid-column field="UnitPrice" title="Unit Price" width="180" filter="numeric" format="{0:c}">
    </kendo-grid-column>
    <kendo-grid-column field="Discontinued" width="120" filter="boolean">
    </kendo-grid-column>
  </kendo-grid>

 

And filter is configured like following:

   public filter = {
          logic: 'or',
          filters: [{ field: 'ProductName', operator: 'contains', value: 'Chef' },
          { field: 'ProductName', operator: 'contains', value: 'Chang' }]
        };

 

Anyway, initial filter does not work and everyting is showed without filter.

 

Could you give me any advice?



Paul
Top achievements
Rank 1
 answered on 23 Mar 2018
1 answer
818 views

The filter icon is currently displayed next to the first line of the column header text (see attached screenshot).  If a grid has some column headers text spanning on a single line, or multi-lines, is it possible to display the filter icon at the bottom line so all columns have the same position of the filter icon ?

One alternative is to set the [headerStyle] of each column to be 'white-space':'nowrap', but then the column header width will be too big if I need to show the full column name.

Thanks for any suggestion.

Svet
Telerik team
 answered on 23 Mar 2018
2 answers
911 views

I have a grid  using the custom remote binding directive, and filtering, sorting work fine via the directive productsBinding rebind().

<kendo-grid #productgrid

                    productsBinding
                    [height]="450"
                    [resizable]="true"
                    [filterable]="true"
                    [filter]="state.filter"
                    [sortable]="true"
                    [sort]="state.sort"
                    [pageSize]="state.take"
                    [pageable]="true"
                    [skip]="state.skip"
                    [selectable]="true">

 <ng-template kendoGridToolbarTemplate>
                <table class="k-grid-ignore-click">
                    <button kendoButton [icon]="'myspace'" style="color:blue;" 
                            (click)="openPayorDeptDialog()" >
                        Select Payor/Dept
                    </button>
                </table>
            </ng-template>

 

Dimiter Topalov
Telerik team
 answered on 22 Mar 2018
1 answer
4.8K+ views

I have this plunker setup with the columns 'FileId Selected' (showing the selected value from the dropdownlist) and 'File Lists' (dropdownlist).

https://plnkr.co/edit/8dhH14k9HTwgdAA4fXsb?p=preview

I would expect to see the first row of the grid 'Hospital A' to show the value "1111 file" highlighted in the dropdownlist on initial rendering, but it does not. Could someone tell me if I missed some setting?

Thanks!

Dimiter Topalov
Telerik team
 answered on 22 Mar 2018
2 answers
272 views

Hi

I have a question on the kendo-panelbar

I added an event handler for stateChange, and in some cases, I want my user to stay on the current panelbar Item.  

Basically, If I have a validation error, i want my user to stay on the current panelbar item and not navigate to the panelbar item they clicked

    public onStateChange(data: Array<PanelBarItemModel>): boolean {
            const previousItem: PanelBarItemModel = data.filter(item => item.focused === false)[0];
            const currentItem: PanelBarItemModel = data.filter(item => item.focused === true)[0];

    .........

                    if (previousSection === 'blah blah'&& !wasSuccessful) {
                        currentItem.selected = false;
                        currentItem.expanded = false;
                        previousItem.selected = true;
                        previousItem.expanded = true;

 

However, my panelBar item does not return to the current panelBar Item

What must I do in order to achieve this navigation?

Thanks


David
Top achievements
Rank 1
 answered on 20 Mar 2018
1 answer
109 views
Does anyone know how to attach to the angular grid column resize and reorder events. The documentation says that these events exist but could not fin out how to attach to them as I have to save the order and sizes.
Paul
Top achievements
Rank 1
 answered on 19 Mar 2018
5 answers
2.8K+ views

Hi,
I've a TreeView and it seem that I'm too stupid to updated data or trigger a reload...

my template:

<kendo-treeview
    kendoTreeViewExpandable
    [nodes]="categories"
    textField="name"
    [children]="fetchChildren"
    [hasChildren]="hasChildren">

 

my component (relevant parts only):

{
    public categories: IProductCategory[];
 
    @ViewChild(TreeViewComponent)
    tree: TreeViewComponent;
 
    fetchChildren = (item: IProductCategory): Observable<IProductCategory[]> => {
        return Observable.create(observer => {
            const categoryListPromise = this._categoriesStore.query({
                filter: { field: 'parentId', operator: 'eq', value: item.id }
            }).then(result => {
                observer.next(result.records);
            });
        });
    };
}

 

so..

* the data input is bound to this.categories, which is a flat list of category objects

* the fetchChildren method loads and returns child categories

 

Now I'll get updates from our (custom) data layer and have to update the tree:

this._categoriesStore.updates().subscribe(e => {
  const event: { record: ICategory, type: 'update'|'delete'|'create' } = e;
  // update tree view ..
  // ???
});

 

I can update the root categories by simply updating the cmp.categories array, but this array does not contain any child nodes. I was looking for something like "tree.getNode().reload()" but,.. nope,.. and I'm confused :-)

So my questions are...

* How can I update child nodes that are loaded using function defined in "children" input?

* How can I tell the tree view to reload children of a single node (execute fetchChildren() again)?

Thanks and best regards,
Chris

Christoph
Top achievements
Rank 1
 answered on 19 Mar 2018
3 answers
1.6K+ views

Hi,

I'm trying to use the Upload control with a an asp.net core web api backend.

My server code is expecting to receive a file with a content-type of 'multipart/form-data', the Upload control is sending it as 'application/json'. Is there a way I can set the content-type of the posted file?

I tried setting the content-type in the UploadEvent (https://www.telerik.com/kendo-angular-ui/components/upload/api/UploadEvent/) 

 

uploadEventHandler(e: UploadEvent) {
    e.headers.set('Content-Type', 'multipart/form-data')
 }

but it was ignored.

 

Dimiter Madjarov
Telerik team
 answered on 19 Mar 2018
1 answer
103 views
Is there a way that the Angular upload component can support uploading of folders + contents like the equivalent Kendo for jQuery Upload control does?
Dimiter Madjarov
Telerik team
 answered on 19 Mar 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?