How to use the nativescript-ui-listview.ListViewViewType.ItemView function in nativescript-ui-listview

To help you get started, we’ve selected a few nativescript-ui-listview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bakerac4 / glimmer-native / dist / src / dom / native / RadListViewElement.js View on Github external
loadView(viewType) {
        if (viewType === ListViewViewType.ItemView) {
            console.log('creating view for ', viewType);
            let wrapper = createElement('StackLayout');
            wrapper.setAttribute('class', 'list-view-item');
            const template = this.itemTemplateComponent;
            const component = GlimmerResolverDelegate.lookupComponent('my-insane-component');
            const compiled = component.compilable.compile(Application.context);
            const cursor = { element: wrapper, nextSibling: null };
            // let component = Compilable(template.args.src);
            // const compiled = component.compile(Application.context);
            let componentInstance = Application._renderComponent(null, cursor, compiled, template.args);
            let nativeEl = wrapper.nativeView;
            nativeEl.__GlimmerComponent__ = componentInstance._meta.component;
            return nativeEl;
        }
    }
    updateListItem(args) {
github bakerac4 / glimmer-native / src / dom / native / RadListViewElement.ts View on Github external
loadView(viewType: string): View {
        if (viewType === ListViewViewType.ItemView) {
            console.log('creating view for ', viewType);
            let wrapper = createElement('StackLayout') as NativeElementNode;
            wrapper.setAttribute('class', 'list-view-item');
            const template = this.itemTemplateComponent as any;
            const component = GlimmerResolverDelegate.lookupComponent('my-insane-component');
            const compiled = component.compilable.compile(Application.context);
            const cursor = { element: wrapper, nextSibling: null } as Cursor;
            // let component = Compilable(template.args.src);
            // const compiled = component.compile(Application.context);
            let componentInstance = Application._renderComponent(null, cursor, compiled, template.args);

            let nativeEl = wrapper.nativeView;
            (nativeEl as any).__GlimmerComponent__ = componentInstance._meta.component;
            return nativeEl;
        }
    }
github halfnelson / svelte-native-nativescript-ui / src / listview / index.ts View on Github external
logger.debug("creating view for " + viewType);

        let wrapper = createElement('StackLayout') as NativeViewElementNode
github halfnelson / svelte-native-nativescript-ui / src / listview / index.ts View on Github external
private loadView(viewType: string): View {
        if (viewType.toLowerCase() == ListViewViewType.ItemView.toLowerCase() && typeof this.nativeElement.itemTemplates == "object" ) {
            let keyedTemplate = this.nativeElement.itemTemplates.find(t => t.key == "default");
            if (keyedTemplate) {
                return keyedTemplate.createView()
            }
        }

        let componentClass = this.getComponentForView(viewType);
        if (!componentClass) return null;
        logger.debug("creating view for " + viewType);

        let wrapper = createElement('StackLayout') as NativeViewElementNode

nativescript-ui-listview

A powerful data list control implementing a bunch of features native to the mobile world as item animations, pull-to-refresh, item layouts, load-on-demand, swipe-to-execute, etc.

Apache-2.0
Latest version published 1 year ago

Package Health Score

67 / 100
Full package analysis