Telerik Forums
Kendo UI for Angular Forum
2 answers
294 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
132 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
3.0K+ 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
111 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
4 answers
231 views

I am following the sample instructions from the link: https://www.telerik.com/kendo-angular-ui/components/grid/data-operations/data-binding/automatic-operations/#toc-custom-directives

In the ProductsBindingDirective, the rebind method calls the service passing the state of the grid.

In the ProductsService which extends NorthwindService (extending BehaviorSubject), the fetch method sends a request to the Base_URL with the grid state info passed as query string parameters, e.g. https://odatasampleservices.azurewebsites.net/V4/Northwind/Northwind.svc/Products?$orderby=UnitPrice&$count=true&$skip=0

Question: Does the Northwind.svc execute a SQL query for every fetch method request, and rebuild a new result set based on the query string parameters? Or does it execute the SQL query once, and applies the query string parameters criteria (skip, orderby, pagesize, etc)  on the same result set initially retrieved?

In my case, I have a query returning tens of thousands of records, so I want to confirm which component is processing the grid state information. Should the ProductsService (being a BehaviorSubject) keep the initial big result set as its own property and apply the grid state criteria, or does it just pass the grid state to the server and expect to receive the correct data?

Thanks!

 

Chau
Top achievements
Rank 1
 answered on 16 Mar 2018
1 answer
647 views

The Angular MultiSelect dropdown control normally opens the dropdown popup when you click inside the search text box. But its not happening in one particular scenario in which you click right next to the last selected value (still inside the search text box). 

So if you have selected some values already and you want to open up the popup again to select more then you have to click approximately a couple of centimeters away from the last selected value in the text box. I can see this happening in the simple demo available in the documentation as well.

Has anybody else observed the same?

Dimiter Topalov
Telerik team
 answered on 16 Mar 2018
2 answers
5.9K+ views

Hi,

Assume I have a datasource with ID and Name fields. I display the Name but the main field is ID. I manage to show the right Name and get the ID with a combobox in Edit and Add mode. But how can I fix the filter for Name?

<kendo-grid-column field="ID" title="Begrepp">
    <ng-template kendoGridCellTemplate let-dataItem>
        {{dataItem.Name}}
    </ng-template>
    <ng-template kendoGridEditTemplate let-dataItem="dataItem" let-column="column" let-formGroup="formGroup" let-isNew="isNew">
        <kendo-combobox [valuePrimitive]="true" [formControl]="formGroup.get(column.field)" [data]="personBegreppData" textField="Name"
            valueField="ID" [placeholder]="dataItem.Name" (filterChange)="handleACFilter($event)"
            [filterable]="true">
        </kendo-combobox>
    </ng-template>
    <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
        <kendo-grid-string-filter-cell [showOperators]="false" [column]="column" [filter]="state.filter">
        </kendo-grid-string-filter-cell>
    </ng-template>
</kendo-grid-column>
Dimiter Topalov
Telerik team
 answered on 16 Mar 2018
3 answers
819 views

TL;DR: Any plans for virtualisation support on Treeview?

I've attached an example project.

The data is a set of companies. Each company has 5 offices. Each office has a collection of Drivers and a collection of Vehicles. There are 1000 Drivers and 1000 Vehicles in each.

1: Run the app
2: Expand a company
3: Expand an office
4: Expand one of the child nodes (Drivers or Vehicles)

On my computer, this takes about 7 seconds to open. I think it is a combination of adding so many DOM elements and also using an ng-template inside the tree.

This might improve in Angular6, but it seems that creating all of those DOM elements is a waste of resources anyway. Do you have any plans for supporting virtualisation in your Treeview component?

 

Georgi Krustev
Telerik team
 answered on 16 Mar 2018
2 answers
528 views

I'm getting this error:

ERROR in node_modules/@progress/kendo-angular-buttons/dist/es/navigation/navigation-config.d.ts(1,10): error TS2305: Module '".../node_modules/@angular/core/core"' has no exported member 'OpaqueToken'.

Using @angular/core version 5.2.9

T. Tsonev
Telerik team
 answered on 16 Mar 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?