Skip to content

Commit 753511e

Browse files
Integrated latest changes at 12-20-2024 4:36:03 PM
1 parent 769f5b9 commit 753511e

File tree

6 files changed

+30
-50
lines changed

6 files changed

+30
-50
lines changed

ej2-react/code-snippet/drop-down-button/item-template-cs1/app/app.jsx

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,20 @@ function App() {
3636
}
3737
];
3838

39+
const template = `
40+
<div>
41+
<span class='e-menu-icon ${'${iconCss}'}'></span>
42+
${
43+
'${url}'
44+
? `<span class='custom-class'><a href='${'${url}'}' target='_blank' rel='noopener noreferrer'>${'${text}'}</a></span>`
45+
: `<span class='custom-class'>${'${text}'}</span>`
46+
}
47+
</div>
48+
`;
49+
3950
return (
4051
<div>
41-
<DropDownButtonComponent
42-
items={items}
43-
itemTemplate={(data) => {
44-
if (data.url) {
45-
return (
46-
<div>
47-
<span className={`e-menu-icon ${data.iconCss}`}></span>
48-
<span class="custom-class"><a href={data.url} target="_blank" rel="noopener noreferrer">{data.text}</a></span>
49-
</div>
50-
);
51-
} else {
52-
return (
53-
<div>
54-
<span className={`e-menu-icon ${data.iconCss}`}></span>
55-
<span class="custom-class">{data.text}</span>
56-
</div>
57-
);
58-
}
59-
}}
60-
>
61-
DropDownButton
62-
</DropDownButtonComponent>
52+
<DropDownButtonComponent items={items} itemTemplate = {template} >DropDownButton</DropDownButtonComponent>
6353
</div>
6454
);
6555
}

ej2-react/code-snippet/drop-down-button/item-template-cs1/app/app.tsx

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,20 @@ function App() {
3636
}
3737
];
3838

39+
const template: string = `
40+
<div>
41+
<span class='e-menu-icon ${'${iconCss}'}'></span>
42+
${
43+
'${url}'
44+
? `<span class='custom-class'><a href='${'${url}'}' target='_blank' rel='noopener noreferrer'>${'${text}'}</a></span>`
45+
: `<span class='custom-class'>${'${text}'}</span>`
46+
}
47+
</div>
48+
`;
49+
3950
return (
4051
<div>
41-
<DropDownButtonComponent
42-
items={items}
43-
itemTemplate={(data: ItemModel) => {
44-
if (data.url) {
45-
return (
46-
<div>
47-
<span className={`e-menu-icon ${data.iconCss}`}></span>
48-
<span class="custom-class"><a href={data.url} target="_blank" rel="noopener noreferrer">{data.text}</a></span>
49-
</div>
50-
);
51-
} else {
52-
return (
53-
<div>
54-
<span className={`e-menu-icon ${data.iconCss}`}></span>
55-
<span class="custom-class">{data.text}</span>
56-
</div>
57-
);
58-
}
59-
}}
60-
>
61-
DropDownButton
62-
</DropDownButtonComponent>
52+
<DropDownButtonComponent items={items} itemTemplate = {template} >DropDownButton</DropDownButtonComponent>
6353
</div>
6454
);
6555
}

ej2-react/code-snippet/image-editor/default-cs57/app/app.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class App extends React.Component {
1515
}
1616
render() {
1717
return (<div className='e-img-editor-sample'>
18-
<ImageEditorComponent ref={(img) => { this.imgObj = img; }} height="350px" uploadSettings = {uploadSettings}>
18+
<ImageEditorComponent ref={(img) => { this.imgObj = img; }} height="350px" uploadSettings = {this.uploadSettings}>
1919
</ImageEditorComponent>
2020
<div>
2121
<ButtonComponent cssClass='e-primary' content='Load Invalid Image' onClick={this.loadInvalidImage.bind(this)}/>

ej2-react/code-snippet/image-editor/default-cs57/app/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ function App() {
1818

1919
return (
2020
<div className='e-img-editor-sample'>
21-
<ImageEditorComponent ref={(img) => { imgObj = img }} uploadSettings = {uploadSettings}>
21+
<ImageEditorComponent ref={(img) => { imgObj = img }} height="350px" uploadSettings = {this.uploadSettings}>
2222
</ImageEditorComponent>
2323
<div>
24-
<ButtonComponent cssClass='e-primary' content='Load Invalid Image' onClick = {loadInvalidImage}/>
24+
<ButtonComponent cssClass='e-primary' content='Load Invalid Image' onClick = {this.loadInvalidImage.bind(this)}/>
2525
</div>
2626
</div>
2727
);

ej2-react/code-snippet/image-editor/default-cs58/app/app.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default class App extends React.Component {
1616
}
1717
render() {
1818
return (<div className='e-img-editor-sample'>
19-
<ImageEditorComponent ref={(img) => { this.imgObj = img; }} height="350px" uploadSettings = {uploadSettings}>
19+
<ImageEditorComponent ref={(img) => { this.imgObj = img; }} height="350px" uploadSettings = {this.uploadSettings}>
2020
</ImageEditorComponent>
2121
<div>
2222
<ButtonComponent cssClass='e-primary' content='Load Invalid Image' onClick={this.loadInvalidImage.bind(this)}/>

ej2-react/code-snippet/image-editor/default-cs58/app/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ function App() {
1919

2020
return (
2121
<div className='e-img-editor-sample'>
22-
<ImageEditorComponent ref={(img) => { imgObj = img }} uploadSettings = {uploadSettings}>
22+
<ImageEditorComponent ref={(img) => { imgObj = img }} height="350px" uploadSettings = {this.uploadSettings}>
2323
</ImageEditorComponent>
2424
<div>
25-
<ButtonComponent cssClass='e-primary' content='Load Invalid Image' onClick = {loadInvalidImage}/>
25+
<ButtonComponent cssClass='e-primary' content='Load Invalid Image' onClick = {this.loadInvalidImage.bind(this)}/>
2626
</div>
2727
</div>
2828
);

0 commit comments

Comments
 (0)