Skip to content

Commit

Permalink
revert(pg)
Browse files Browse the repository at this point in the history
  • Loading branch information
marker dao ® committed Dec 20, 2024
1 parent 5248914 commit 99bc7bf
Showing 1 changed file with 5 additions and 339 deletions.
344 changes: 5 additions & 339 deletions packages/devextreme/playground/jquery.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title>DevExtreme jQuery Example</title>

Expand Down Expand Up @@ -42,354 +41,21 @@
<script type="text/javascript" src="../artifacts/js/dx.all.debug.js" charset="utf-8"></script>
<script type="text/javascript" src="./themeSelector.js"></script>
<script type="text/javascript" src="../../../node_modules/axe-core/axe.min.js"></script>

<style>
.dx-surface {
height: 50vh;
}

.dx-surface>div {
height: 100%;
}

.demo-container {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100%;
}
</style>
</head>

<body class="dx-surface">
<div role="main">
<h1 style="position: fixed; left: 0; top: 0; clip: rect(1px, 1px, 1px, 1px);">Test header</h1>

<select id="theme-selector" style="display: block;">
</select>
<br />

<div class="dx-viewport demo-container">
<div id='editor'></div>
<div id='button'></div>
<!-- <div id='button2'></div> -->
</div>

<div id="button"></div>
<script>
$(() => {
const products = [{
ID: 1,
Name: 'HD Video Player',
Price: 330,
Current_Inventory: 225,
Backorder: 0,
Manufacturing: 10,
Category: 'Video Players',
ImageSrc: 'images/products/1-small.png',
}, {
ID: 2,
Name: 'SuperHD Player',
Price: 400,
Current_Inventory: 150,
Backorder: 0,
Manufacturing: 25,
Category: 'Video Players',
ImageSrc: 'images/products/2-small.png',
}, {
ID: 3,
Name: 'SuperPlasma 50',
Price: 2400,
Current_Inventory: 0,
Backorder: 0,
Manufacturing: 0,
Category: 'Televisions',
ImageSrc: 'images/products/3-small.png',
}, {
ID: 4,
Name: 'SuperLED 50',
Price: 1600,
Current_Inventory: 77,
Backorder: 0,
Manufacturing: 55,
Category: 'Televisions',
ImageSrc: 'images/products/4-small.png',
}, {
ID: 5,
Name: 'SuperLED 42',
Price: 1450,
Current_Inventory: 445,
Backorder: 0,
Manufacturing: 0,
Category: 'Televisions',
ImageSrc: 'images/products/5-small.png',
}, {
ID: 6,
Name: 'SuperLCD 55',
Price: 1350,
Current_Inventory: 345,
Backorder: 0,
Manufacturing: 5,
Category: 'Televisions',
ImageSrc: 'images/products/6-small.png',
}, {
ID: 7,
Name: 'SuperLCD 42',
Price: 1200,
Current_Inventory: 210,
Backorder: 0,
Manufacturing: 20,
Category: 'Televisions',
ImageSrc: 'images/products/7-small.png',
}, {
ID: 8,
Name: 'SuperPlasma 65',
Price: 3500,
Current_Inventory: 0,
Backorder: 0,
Manufacturing: 0,
Category: 'Televisions',
ImageSrc: 'images/products/8-small.png',
}, {
ID: 9,
Name: 'SuperLCD 70',
Price: 4000,
Current_Inventory: 95,
Backorder: 0,
Manufacturing: 5,
Category: 'Televisions',
ImageSrc: 'images/products/9-small.png',
}, {
ID: 10,
Name: 'DesktopLED 21',
Price: 175,
Current_Inventory: 0,
Backorder: 425,
Manufacturing: 75,
Category: 'Monitors',
ImageSrc: 'images/products/10-small.png',
}, {
ID: 11,
Name: 'DesktopLED 19',
Price: 165,
Current_Inventory: 425,
Backorder: 0,
Manufacturing: 110,
Category: 'Monitors',
ImageSrc: 'images/products/11-small.png',
}, {
ID: 12,
Name: 'DesktopLCD 21',
Price: 170,
Current_Inventory: 210,
Backorder: 0,
Manufacturing: 60,
Category: 'Monitors',
ImageSrc: 'images/products/12-small.png',
}, {
ID: 13,
Name: 'DesktopLCD 19',
Price: 160,
Current_Inventory: 150,
Backorder: 0,
Manufacturing: 210,
Category: 'Monitors',
ImageSrc: 'images/products/13-small.png',
}, {
ID: 14,
Name: 'Projector Plus',
Price: 550,
Current_Inventory: 0,
Backorder: 55,
Manufacturing: 10,
Category: 'Projectors',
ImageSrc: 'images/products/14-small.png',
}, {
ID: 15,
Name: 'Projector PlusHD',
Price: 750,
Current_Inventory: 110,
Backorder: 0,
Manufacturing: 90,
Category: 'Projectors',
ImageSrc: 'images/products/15-small.png',
}, {
ID: 16,
Name: 'Projector PlusHT',
Price: 1050,
Current_Inventory: 0,
Backorder: 75,
Manufacturing: 57,
Category: 'Projectors',
ImageSrc: 'images/products/16-small.png',
}, {
ID: 17,
Name: 'ExcelRemote IR',
Price: 150,
Current_Inventory: 650,
Backorder: 0,
Manufacturing: 190,
Category: 'Automation',
ImageSrc: 'images/products/17-small.png',
}, {
ID: 18,
Name: 'ExcelRemote BT',
Price: 180,
Current_Inventory: 310,
Backorder: 0,
Manufacturing: 0,
Category: 'Automation',
ImageSrc: 'images/products/18-small.png',
}, {
ID: 19,
Name: 'ExcelRemote IP',
Price: 200,
Current_Inventory: 0,
Backorder: 325,
Manufacturing: 225,
Category: 'Automation',
ImageSrc: 'images/products/19-small.png',
}];

const items = ['Whoosh!'];

const positions = [
"HR Manager",
"IT Manager",
"CEO",
"Controller",
"Sales Manager",
"Support Manager",
"Shipping Manager"
];

const positionsDS = new DevExpress.data.DataSource({
store: new DevExpress.data.CustomStore({
load: (loadOptions) => {
return positions;
},
byKey: (key) => {
// debugger
console.log("bykey");
return key;
}
})
});

const productsDS = new DevExpress.data.ArrayStore({
data: products,
key: 'ID',
});

// const editor = $('#editor').dxTextBox({
// value: 'CUSTOM',
// // value: '',
// // value: null,
// // value: undefined,
// onInput: (e) => {
// const { value, text } = e.component.option();

// if (text === 'CUSTO') {
// // e.component.resetOption('text');
// e.component.reset();
// }
// },
// // onValueChanged: (e) => {
// // debugger
// // },
// }).dxTextBox('instance');

// const editor = $('#editor').dxDateRangeBox({
// value: ['11/11/1111', '11/11/1111'],
// onOptionChanged: (e) => {
// if (e.fullName === 'startDateText' && e.value === '123') {
// e.component.reset();
// }
// // debugger
// },
// // onValueChanged: (e) => {
// // debugger
// // },
// }).dxDateRangeBox('instance');

// const editor = $('#editor').dxSelectBox({
// acceptCustomValue: true,
// dataSource: positionsDS,
// value: positions[0],
// // value: null,
// onInput: (e) => {
// if (e.component.option('text') === 'HR Manage') {
// e.component.reset();
// }
// },
// }).dxSelectBox('instance');

const editor = $('#editor').dxSelectBox({
acceptCustomValue: true,
// dataSource: productsDS,
items: products,
displayExpr: 'Name',
valueExpr: 'ID',
value: products[0].ID,
onInput: (e) => {
// if (e.component.option('text') === 'SuperHD Playe') {
if (e.component.option('text') === 'HD Video Playe') {
const { text, value } = e.component.option();

// debugger

e.component.reset();
}
},
}).dxSelectBox('instance');

// const editor = $('#editor').dxDropDownList({
// // dataSource: positionsDS,
// // value: positions[0],
// items,
// value: items[0],
// acceptCustomValue: true,
// onInput: (e) => {
// const { text, value, items } = e.component.option();

// debugger;
// },
// onValueChanged: (e) => {
// // debugger;
// },
// }).dxDropDownList('instance');

const INPUT_CLASS = 'dx-texteditor-input';
const $input = $(`.${INPUT_CLASS}`);

$('#button').dxButton({
text: 'reset',
onClick: async () => {
// const inputValue = $input.eq(0).val();
// const { value } = editor.option();

// debugger;

await editor.reset();

// const inputValue2 = $input.eq(0).val();
// const { value: value2 } = editor.option();

// debugger
}
$(function() {
$("#button").dxButton({
text: 'Click me!',
onClick: function() { alert("clicked"); }
});

// $('#button2').dxButton({
// text: 'clear',
// onClick: async () => {
// await editor.clear();

// // setTimeout(() => {
// // const { text, value } = editor.option();

// // debugger;
// // }, 0);
// }
// });
});
</script>
</div>
Expand Down

0 comments on commit 99bc7bf

Please sign in to comment.