kittaya Posted June 18, 2021 Report Posted June 18, 2021 5 minutes ago, usauae said: super bro stackblitz lo work avutundi, but not on my page. may be because there are more than one list on the page. chustunna easy ga yemi aina fix cheyavachhu yemo ani Inka easy cheyachu, to give solution superfast... I did best of best Quote
usauae Posted June 18, 2021 Author Report Posted June 18, 2021 36 minutes ago, kittaya said: Inka easy cheyachu, to give solution superfast... I did best of best any help on this error bro ? myTypes: MyType[] = []; Property 'scrollIntoView' does not exist on type 'MyType'. Quote
Kootami Posted June 18, 2021 Report Posted June 18, 2021 1 minute ago, usauae said: any help on this error bro ? myTypes: MyType[] = []; Property 'scrollIntoView' does not exist on type 'MyType'. just filter the list using observable or use pipes to retain import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'SearchPipe', pure: false }) export class SearchPipe implements PipeTransform { transform(items: any[], filter: any): any { if (!items || !filter) { return items; } // filter items array, items which match and return true will be // kept, false will be filtered out return items.filter(item => item.StrValue.toLowerCase().indexOf(filter.toLowerCase())>-1); } } *ngFor="let name of SearchResult | SearchPipe:searchword;let i=index" Quote
usauae Posted June 18, 2021 Author Report Posted June 18, 2021 34 minutes ago, Kootami said: just filter the list using observable or use pipes to retain import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'SearchPipe', pure: false }) export class SearchPipe implements PipeTransform { transform(items: any[], filter: any): any { if (!items || !filter) { return items; } // filter items array, items which match and return true will be // kept, false will be filtered out return items.filter(item => item.StrValue.toLowerCase().indexOf(filter.toLowerCase())>-1); } } *ngFor="let name of SearchResult | SearchPipe:searchword;let i=index" bro mukka ardam kaaledu yemi anukoku Quote
usauae Posted June 18, 2021 Author Report Posted June 18, 2021 Included Players G H I J K L M Btn Include < Btn Exclude > Excluded Players A B C D E F N Quote
usauae Posted June 18, 2021 Author Report Posted June 18, 2021 basically naa ui ila vundi bro same list on both sides but I need to move the liste items to either include or exclude list. Quote
HtmlBro Posted June 19, 2021 Report Posted June 19, 2021 10 hours ago, kittaya said: import { Component } from '@angular/core'; import { fromEvent } from 'rxjs'; @Component({ selector: 'my-app', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { name = 'Angular'; items: any[] = [ { name: 'A Sachin' }, { name: 'B Sachin' }, { name: 'C Sachin' }, { name: 'D Sachin' }, { name: 'E Sachin' }, { name: 'F Sachin' }, { name: 'G Sachin' }, { name: 'H Sachin' }, { name: 'I Sachin' }, { name: 'J Sachin' }, { name: 'K Sachin' }, { name: 'L Sachin' } ]; idList = []; getId(val, i) { this.idList.push(val.split(' ')[0] + i); return val.split(' ')[0]; } getrespectiveId(key) { return this.idList[ this.idList.findIndex( val => val.split('')[0].toLowerCase() == key.toLowerCase() ) ]; } constructor() { fromEvent(window, 'keydown').subscribe((event: KeyboardEvent) => { console.log(event.key); console.log(this.getrespectiveId(event.key)); document.getElementById(this.getrespectiveId(event.key)).scrollIntoView({ behavior: 'smooth' }); }); } } Yee code PR ke submit cheste ofc ninche bayataku 10gaa mantaru. Functional programming ledu dom manipulations Constructor lo. Malli angular use chesta. Naku weekend evu. I will show the right way. Quote
HtmlBro Posted June 19, 2021 Report Posted June 19, 2021 11 hours ago, kittaya said: knchm jquery vaadu broo... window keyup event listen cheyyali hostlisner all the time then fire event use jquery or javascript to move specific ID Jquery Sanka naki poye 10 yellow avutunde. Eppudu nevu jquery use cheste nevu ave potavu. Quote
kittaya Posted June 19, 2021 Report Posted June 19, 2021 11 hours ago, kittaya said: Inka easy cheyachu, to give solution superfast... I did best of best 47 minutes ago, HtmlBro said: Yee code PR ke submit cheste ofc ninche bayataku 10gaa mantaru. Functional programming ledu dom manipulations Constructor lo. Malli angular use chesta. Naku weekend evu. I will show the right way. Quote
kittaya Posted June 19, 2021 Report Posted June 19, 2021 47 minutes ago, HtmlBro said: Yee code PR ke submit cheste ofc ninche bayataku 10gaa mantaru. Functional programming ledu dom manipulations Constructor lo. Malli angular use chesta. Naku weekend evu. I will show the right way. Agreed 👍 take your time and post it Quote
kittaya Posted June 19, 2021 Report Posted June 19, 2021 9 hours ago, usauae said: basically naa ui ila vundi bro same list on both sides but I need to move the liste items to either include or exclude list. Event fire ayyaka... You do whatever you want... You got the choice... Here trick is catching event and scroll. And next is usual basic code ae ga Quote
Mr Mirchi Posted June 19, 2021 Report Posted June 19, 2021 13 hours ago, usauae said: bros, naaku oka list item vundi, which has hundreds of names sorted alphabetically(source API). requirement: if I type 'F' on my keyboard, the list should scroll lo the names starting with F. yevaru aina ilantidi chesara ? can you please help me https://stackblitz.com/edit/angular-lrsztw?file=src/app/app.component.html Event binding use karo Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.