{"id":43687783,"url":"https://github.com/PeterStaev/NativeScript-Grid-View","last_synced_at":"2026-02-16T13:01:49.747Z","repository":{"id":57308544,"uuid":"42646739","full_name":"PeterStaev/NativeScript-Grid-View","owner":"PeterStaev","description":"A NatvieScript GridView widget.","archived":false,"fork":false,"pushed_at":"2020-05-14T07:15:21.000Z","size":6960,"stargazers_count":49,"open_issues_count":3,"forks_count":28,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-03T15:44:14.618Z","etag":null,"topics":["android","grid","gridview","ios","nativescript","uicollectionview"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PeterStaev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-17T09:14:48.000Z","updated_at":"2024-05-30T15:50:55.000Z","dependencies_parsed_at":"2022-08-28T23:03:34.519Z","dependency_job_id":null,"html_url":"https://github.com/PeterStaev/NativeScript-Grid-View","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/PeterStaev/NativeScript-Grid-View","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterStaev%2FNativeScript-Grid-View","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterStaev%2FNativeScript-Grid-View/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterStaev%2FNativeScript-Grid-View/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterStaev%2FNativeScript-Grid-View/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterStaev","download_url":"https://codeload.github.com/PeterStaev/NativeScript-Grid-View/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterStaev%2FNativeScript-Grid-View/sbom","scorecard":{"id":109441,"data":{"date":"2025-08-11","repo":{"name":"github.com/PeterStaev/NativeScript-Grid-View","commit":"aa719b169b9f6a05c168c8850b99cb582eae7dd6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 4/30 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"109 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-c75v-2vq8-878f","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-vvj3-85vf-fgmw","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-779f-wgxg-qr8f","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-9v62-24cr-58cx","Warn: Project is vulnerable to: GHSA-r8f7-9pfq-mjmv","Warn: Project is vulnerable to: GHSA-cwx2-736x-mf6w","Warn: Project is vulnerable to: GHSA-v39p-96qg-c8rf","Warn: Project is vulnerable to: GHSA-8v63-cqqc-6r2c","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-7mwh-4pqv-wmr8","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-884p-74jh-xrg2","Warn: Project is vulnerable to: GHSA-j7fq-p9q7-5wfv","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-pgr8-jg6h-8gw6","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp","Warn: Project is vulnerable to: GHSA-957j-59c2-j692","Warn: Project is vulnerable to: GHSA-m5pj-vjjf-4m3h","Warn: Project is vulnerable to: GHSA-j383-35pm-c5h4","Warn: Project is vulnerable to: GHSA-rm36-94g8-835r","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-v2p6-4mp7-3r9v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T11:46:16.789Z","repository_id":57308544,"created_at":"2025-08-15T11:46:16.790Z","updated_at":"2025-08-15T11:46:16.790Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29508735,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","grid","gridview","ios","nativescript","uicollectionview"],"created_at":"2026-02-05T03:00:21.768Z","updated_at":"2026-02-16T13:01:49.741Z","avatar_url":"https://github.com/PeterStaev.png","language":"TypeScript","readme":"**This repo only supports NativeScript pre-6.0. The latest version of the plugin supporting NS 6+ is availble as part of [ProPlugins](https://proplugins.org).**\n# NativeScript GridView widget\n[![Build Status](https://travis-ci.org/PeterStaev/NativeScript-Grid-View.svg?branch=master)](https://travis-ci.org/PeterStaev/NativeScript-Grid-View)\n[![npm downloads](https://img.shields.io/npm/dm/nativescript-grid-view.svg)](https://www.npmjs.com/package/nativescript-grid-view)\n[![npm downloads](https://img.shields.io/npm/dt/nativescript-grid-view.svg)](https://www.npmjs.com/package/nativescript-grid-view)\n[![npm](https://img.shields.io/npm/v/nativescript-grid-view.svg)](https://www.npmjs.com/package/nativescript-grid-view)\n\nA NativeScript GridView widget. The GridView displays data in separate cells, each cell representing one data item. For iOS wraps up [UICollectionView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionView_class/) and for Android wraps up [RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html)\n\n## Screenshot\n![Screenshot of Android](https://raw.githubusercontent.com/PeterStaev/NativeScript-Grid-View/master/docs/screenshot.png)\n\n## Installation\nRun the following command from the root of your project:\n\n`tns plugin add nativescript-grid-view`\n\nThis command automatically installs the necessary files, as well as stores nativescript-grid-view as a dependency in your project's package.json file.\n\n## Configuration\nThere is no additional configuration needed!\n\n## API\n\n### Events\n* **itemLoading**  \nTriggered when generating an item in the GridView. \n\n* **itemTap**  \nTriggered when the user taps on an item in the GridView. \n\n* **loadMoreItems**  \nTriggered when the generated items reached the end of the items property.\n\n* **scroll**  \nTriggered when the GrdiView is scrolled by the user. from the `args` you can get the new horizonta/vertical offset.\n\n### Static Properties\n* **itemLoadingEvent** - *String*  \nString value used when hooking to itemLoadingEvent event.\n\n* **itemTapEvent** - *String*  \nString value used when hooking to itemTapEvent event.\n\n* **loadMoreItemsEvent** - *String*  \nString value used when hooking to itemTapEvent event.\n\n* **scrollEvent** - *String*  \nString value used when hooking to scroll event.\n\n### Instance Properties\n* **ios** - *[UICollectionView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionView_class/)*  \nGets the native iOS view that represents the user interface for this component. Valid only when running on iOS.\n\n* **android** - *[android.support.v7.widget.RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html)*  \nGets the native android widget that represents the user interface for this component. Valid only when running on Android OS.\n\n* **items** - *Array | ItemsSource*  \nGets or sets the items collection of the GridView. The items property can be set to an array or an object defining length and getItem(index) method.\n\n* **itemTemplate** - *String*  \nGets or sets the item template of the GridView.\n\n* **rowHeight** - *PercentLength*  \nGets or sets the height for every row in the GridView.\n\n* **colWidth** - *PercentLength*  \nGets or sets the width for every column in the GridView.\n\n### Instance Methods\n* **refresh()**  \nForces the GridView to reload all its items.\n\n* **scrollToIndex(index: number, animated: boolean = true)**  \nScrolls the GridView to the item with the given index. This can be either animated or not. Defaults to animated.\n\n## Usage\nYou need to add `xmlns:gv=\"nativescript-grid-view\"` to your page tag, and then simply use `\u003cgv:GridView/\u003e` in order to add the widget to your page. Use `\u003cgv:Gridview.itemTemplate/\u003e` to specify the template for each cell:\n\n```xml\n\u003c!-- test-page.xml --\u003e\n\u003cPage xmlns=\"http://schemas.nativescript.org/tns.xsd\" xmlns:gv=\"nativescript-grid-view\" loaded=\"pageLoaded\"\u003e\n  \u003cGridLayout\u003e\n    \u003cgv:GridView items=\"{{ items }}\" colWidth=\"24%\" rowHeight=\"15%\" padding=\"5\" itemTap=\"gridViewItemTap\" itemLoading=\"gridViewItemLoading\" loadMoreItems=\"gridViewLoadMoreItems\"\u003e\n      \u003cgv:GridView.itemTemplate\u003e\n        \u003cGridLayout backgroundColor=\"#33ffff\" style=\"margin: 5\"\u003e\n          \u003cLabel text=\"{{ value }}\" verticalAlignment=\"center\"/\u003e\n        \u003c/GridLayout\u003e\n      \u003c/gv:GridView.itemTemplate\u003e\n    \u003c/gv:GridView\u003e\n  \u003c/GridLayout\u003e\n\u003c/Page\u003e\n```\n\n```ts\n// test-page.ts\nimport { EventData, Observable } from \"data/observable\";\nimport { ObservableArray } from \"data/observable-array\";\nimport { Page } from \"ui/page\";\n\nimport { GridItemEventData } from \"nativescript-grid-view\";\n\nlet viewModel: Observable;\n\nexport function pageLoaded(args: EventData) {\n    const page = args.object as Page;\n    const items = new ObservableArray();\n\n    for (let loop = 0; loop \u003c 200; loop++) {\n        items.push({ value: \"test \" + loop.toString() });\n    }\n    viewModel = new Observable();\n    viewModel.set(\"items\", items);\n\n    page.bindingContext = viewModel;\n}\n\nexport function gridViewItemTap(args: GridItemEventData) {\n    console.log(\"tap index \" + args.index.toString());\n}\n\nexport function gridViewItemLoading(args: GridItemEventData) {\n    console.log(\"item loading \" + args.index.toString());\n}\n\nexport function gridViewLoadMoreItems(args: EventData) {\n    console.log(\"load more items\");\n}\n```\n\nYou can also have multiple templates the same way you add them in the builtin `ListView` control:\n```xml\n\u003cgv:GridView id=\"gv\" row=\"0\" class=\"{{ cssClass }}\" items=\"{{ items }}\" \n                colWidth=\"{{ colWidth }}\" rowHeight=\"{{ rowHeight }}\" itemTemplateSelector=\"templateSelector\"\n                itemTap=\"gridViewItemTap\" itemLoading=\"gridViewItemLoading\" loadMoreItems=\"gridViewLoadMoreItems\"\u003e\n    \u003cgv:GridView.itemTemplates\u003e\n        \u003ctemplate key=\"odd\"\u003e\n            \u003cGridLayout backgroundColor=\"#33ffff\" style=\"margin: 10 10 0 0\"\u003e\n                \u003cLabel text=\"{{ value }}\" verticalAlignment=\"center\"/\u003e\n            \u003c/GridLayout\u003e\n        \u003c/template\u003e\n\n        \u003ctemplate key=\"even\"\u003e\n            \u003cGridLayout backgroundColor=\"#33ffff\" rows=\"auto, auto\" style=\"margin: 10 10 0 0\"\u003e\n                \u003cLabel row=\"0\" text=\"{{ value }}\" verticalAlignment=\"center\"/\u003e\n                \u003cLabel row=\"1\" text=\"{{ value }}\" verticalAlignment=\"center\"/\u003e\n            \u003c/GridLayout\u003e\n        \u003c/template\u003e\n    \u003c/gv:GridView.itemTemplates\u003e\n\u003c/gv:GridView\u003e\n```\n```ts\nexport function templateSelector(item: any, index: number, items: any) {\n    return index % 2 === 0 ? \"even\" : \"odd\";\n}\n```\n\n## Usage in Angular\n\nImport `GridViewModule` in your `NgModule`:\n\n```typescript\nimport { GridViewModule } from 'nativescript-grid-view/angular';\n\n@NgModule({\n    //......\n    imports: [\n        //......\n        GridViewModule,\n        //......\n    ],\n    //......\n})\n```\n\n#### Example Usage\n```ts\n// app.module.ts\nimport { GridViewModule } from \"nativescript-grid-view/angular\";\n\n@NgModule({\n    bootstrap: [\n        AppComponent\n    ],\n    imports: [\n        NativeScriptModule,\n        AppRoutingModule,\n        GridViewModule,\n    ],\n    declarations: [\n        AppComponent,\n        ItemsComponent,\n        ItemDetailComponent\n    ],\n    providers: [\n        ItemService\n    ],\n    schemas: [\n        NO_ERRORS_SCHEMA\n    ]\n})\nexport class AppModule { }\n```\n\n```html\n\u003c!-- my.component.html --\u003e\n\u003cGridLayout class=\"page\"\u003e\n  \u003cGridView [items]=\"items\" colWidth=\"30%\" rowHeight=\"100\"\u003e\n    \u003cng-template let-item=\"item\" let-odd=\"odd\"\u003e\n      \u003cStackLayout margin=\"10\" [nsRouterLink]=\"['/item', item.id]\" borderColor=\"blue\" borderWidth=\"2\" borderRadius=\"5\" verticalAlignment=\"stretch\" class=\"list-group-item\" [class.odd]=\"odd\"\u003e\n        \u003cLabel verticalAlignment=\"center\" [text]=\"item.name\" class=\"list-group-item-text\" textWrap=\"true\"\u003e\u003c/Label\u003e\n      \u003c/StackLayout\u003e\n    \u003c/ng-template\u003e\n  \u003c/GridView\u003e\n\u003c/GridLayout\u003e\n```\n\nIf you want to use multiple item templates, you can do that very similarly to how you do it for the builtin `ListView` control.\n```html\n\u003cGridView row=\"1\" [items]=\"items\" colWidth=\"33%\" rowHeight=\"100\" [itemTemplateSelector]=\"templateSelector\"\u003e\n    \u003cng-template nsTemplateKey=\"Defender\" let-item=\"item\" let-odd=\"odd\"\u003e\n        \u003cStackLayout [nsRouterLink]=\"['/item', item.id]\" borderColor=\"blue\" borderWidth=\"2\" borderRadius=\"5\" verticalAlignment=\"stretch\" class=\"list-group-item\" [class.odd]=\"odd\"\u003e\n        \u003cLabel verticalAlignment=\"center\" [text]=\"item.name\" class=\"list-group-item-text\" textWrap=\"true\"\u003e\u003c/Label\u003e\n        \u003c/StackLayout\u003e\n    \u003c/ng-template\u003e\n\n    \u003cng-template nsTemplateKey=\"Goalkeeper\" let-item=\"item\" let-odd=\"odd\"\u003e\n        \u003cStackLayout [nsRouterLink]=\"['/item', item.id]\" borderColor=\"black\" borderWidth=\"2\" borderRadius=\"5\" verticalAlignment=\"stretch\" class=\"list-group-item\" [class.odd]=\"odd\"\u003e\n        \u003cLabel verticalAlignment=\"center\" [text]=\"item.name\" class=\"list-group-item-text\" textWrap=\"true\"\u003e\u003c/Label\u003e\n        \u003c/StackLayout\u003e\n    \u003c/ng-template\u003e\n\n    \u003cng-template nsTemplateKey=\"Midfielder\" let-item=\"item\" let-odd=\"odd\"\u003e\n        \u003cStackLayout [nsRouterLink]=\"['/item', item.id]\" borderColor=\"yellow\" borderWidth=\"2\" borderRadius=\"5\" verticalAlignment=\"stretch\" class=\"list-group-item\" [class.odd]=\"odd\"\u003e\n        \u003cLabel verticalAlignment=\"center\" [text]=\"item.name\" class=\"list-group-item-text\" textWrap=\"true\"\u003e\u003c/Label\u003e\n        \u003c/StackLayout\u003e\n    \u003c/ng-template\u003e\n\n    \u003cng-template nsTemplateKey=\"Forward\" let-item=\"item\" let-odd=\"odd\"\u003e\n        \u003cStackLayout [nsRouterLink]=\"['/item', item.id]\" borderColor=\"red\" borderWidth=\"2\" borderRadius=\"5\" verticalAlignment=\"stretch\" class=\"list-group-item\" [class.odd]=\"odd\"\u003e\n        \u003cLabel verticalAlignment=\"center\" [text]=\"item.name\" class=\"list-group-item-text\" textWrap=\"true\"\u003e\u003c/Label\u003e\n        \u003c/StackLayout\u003e\n    \u003c/ng-template\u003e\n\u003c/GridView\u003e\n```\n\n## Demos\nThis repository includes both Angular and plain NativeScript demos. In order to run those execute the following in your shell:\n```shell\n$ git clone https://github.com/peterstaev/nativescript-grid-view\n$ cd nativescript-grid-view\n$ npm install\n$ npm run demo-ios\n```\nThis will run the plain NativeScript demo project on iOS. If you want to run it on Android simply use the `-android` instead of the `-ios` sufix. \n\nIf you want to run the Angular demo simply use the `demo-ng-` prefix instead of `demo-`. \n\n## Donate\n[![Donate](https://img.shields.io/badge/paypal-donate-brightgreen.svg)](https://bit.ly/2AS9QKB)\n\n`bitcoin:14fjysmpwLvSsAskvLASw6ek5XfhTzskHC`\n\n![Donate](https://www.tangrainc.com/qr.png)\n","funding_links":[],"categories":["Awesome {N} [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)"],"sub_categories":["Table of Contents"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPeterStaev%2FNativeScript-Grid-View","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPeterStaev%2FNativeScript-Grid-View","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPeterStaev%2FNativeScript-Grid-View/lists"}