Skip to content

Commit a98053d

Browse files
author
ROOT\jesusarockias
committed
config(EJ2-6101): version 16.1.24 released
1 parent e861fd7 commit a98053d

File tree

982 files changed

+75250
-2813
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

982 files changed

+75250
-2813
lines changed

README.md

Lines changed: 86 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,105 @@
1+
# JavaScript Sample Browser
12

3+
## Adding New Sample
24

3-
## Installing
5+
Create your new folder in 'src' location and name the folder as control name. Example: “button” or "list-view".
46

5-
To install all dependent packages, use the below command
7+
Add your sample order in the `src/common/sampleOrder.json` with corresponding category.
8+
9+
**Note:** Do not use whitespace at any cause in the folder’s name. Use “-” instead of space.
10+
11+
12+
### Configure the folder and sample
13+
14+
Create the “sample.json” file inside of your control folder. Create your sample html and js file in same folder also the html and js files should have the same names.
15+
16+
**Note:** Do not use whitespace at any cause in the file’s name. Use “-” instead of space.
17+
18+
19+
### Configure Sample JSON
20+
21+
Configure your sample json file as like below code snippet.
622

723
```
8-
npm install
24+
{
25+
"name": "Grid",
26+
"directory": "grid",
27+
"category": "Grid",
28+
"samples": [
29+
{ "url": "localdata", "name": "Local Data", "category": "Data Binding" },
30+
{ "url": "remotedata", "name": "Remote Data", "category": "Data Binding" },
31+
{ "url": "autowrap", "name": "AutoWrap Column Cells", "category": "Columns" },
32+
{ "url": "showhide", "name": "Show or Hide Column", "category": "Columns" }
33+
],
34+
"dataSourcePath": "src/grid/datasource.js"
35+
}
936
```
37+
**Note:** To exculde a sample in the device you need to set `hideOnDevice` as true for the sample json file.
38+
39+
**Fields Description:**
40+
41+
* _name :_ It can be any string that you want to show a component name.
42+
43+
* _directory :_ Specifies that your sample's directory name.
44+
45+
* _category :_ Specify that your sample comes under which category.
46+
47+
* _dataSourcePath :_ Specify that your data source file Path (Optional).
48+
49+
* _samples :_ Specify array of samples in your control.
50+
51+
* _samples.url :_ specifies the file name without extension.
52+
53+
* _samples.name :_ It can be any string that you want to show a sample name.
54+
55+
* _samples.category :_ Specify that your sample comes under which category.
1056

11-
## Building
1257

13-
To compile the source files, use the below command
58+
## Adding datasource components
59+
60+
To add datasource file for the component, you need to include the `dataSourcePath` option which need to map the datasource file path in the component's sample.json.
61+
62+
refer the below link for config
63+
64+
https://gitlab.syncfusion.com/essential-studio/ej2-javascript-samples/blob/7a32bea49aca215fdef1fe432e4135fa07ff3c83/src/grid/sample.json#L9
65+
66+
The sample datasource file need to store the json in window variable.
67+
68+
Each component's datasource window variable name must be unique.
69+
70+
For example datasource for grid must be stored as `window.gridData`.
71+
72+
Refer the below below datasource file for further reference
73+
74+
https://gitlab.syncfusion.com/essential-studio/ej2-javascript-samples/blob/19761f5590b4af5b2ea1cb90bed33d8dfa496de9/src/grid/datasource.js
75+
76+
**Note:** Each component should include one datasource file only.
77+
78+
## Run the sample browser
79+
80+
We can run the sample browser with two commands
81+
82+
1. **gulp _serve_** – run the sample browser alone.
83+
2. **gulp _watch_** – run the sample browser and monitor typescript as well. This will help at development time. If any changes detect means it will automatically compile and browser will reloaded.
1484

1585
```
16-
npm run build
86+
gulp serve
1787
```
1888

19-
## Testing
2089

21-
To test the source files, use the below command
90+
**Access URLs:**
91+
92+
Local URL is works only in your machine.
2293

2394
```
24-
npm run test
95+
http://localhost:3000
2596
```
2697

27-
## Running
28-
29-
To run the samples, use the below command
98+
External URL is works in all locally connected LAN. (You can use to see sample browser in mobile).
3099

31100
```
32-
npm run serve
33-
```
101+
http://your-ip-address:3000
102+
```
103+
104+
**Note:** Here, The mentioned IP is your local machine IP Address.
105+

config.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"htmllint": ["./src/**/*.html"],
3+
"json": ["./**/*.json"],
4+
"samplejson": ["./src/**/*sample.json"],
5+
"dedupe": ["./src/**/*.js"],
6+
"watchSample": ["./src/**/*.js"],
7+
"jshint": ["./src/**/*.js", "!./src/**/*.min.js", "!./src/common/samplelist.js", "!./src/common/api-table-generator.js","!./src/common/search-index.js"],
8+
"github": ["./src/**/*.{html,ts,json}", "./styles{,/**}", "./src/**/images{,/**}", "./src/common/lib{,/**}", "./src/common/cldr-data{,/**}", "./src/showcase{,/**}", "!./src/showcase/**/!(webpack.config)*.{js,json}", "!./styles/**/!(index)*.css", "./spec/**/*.ts", "./*.html", "./favicon.ico", "karma.conf.js", "package.json", "test-main.js", "tsconfig.json", "webpack.config.js", "!./googlec03dd4bc003151bc.html", "license"]
9+
}

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,4 +362,4 @@ gulp.task('js-hint', function () {
362362
.pipe(jshint())
363363
.pipe(jshint.reporter('default'))
364364
.pipe(jshint.reporter('fail'));
365-
});
365+
});

0 commit comments

Comments
 (0)