Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-sort-search-table
Advanced tools
Readme
Live demo: https://grace951.github.io/react-table/
Need more example? See examples
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js"></script>
let MyData = [
{
cat: 1,
_id: "d-rhe-428-j",
imageUrl: "img/products/rhe-428-j.png",
name: "RHE-428-J (4ch Compact)",
brand: "iCATCH",
type: "HD-SDI",
channel: 4,
remote: "LAN, ie, iPhone, iPad, Android, 3G mobile",
backup: "USB, Network",
videoout: "HDMI, VGA",
},
{
cat: 1,
_id: "srd-482",
imageUrl: "img/products/srd-482-2.jpg",
name: "SRD-482 (4ch)",
brand: "Samsung",
type: "HD-SDI",
channel: 4,
remote: "LAN, ie, iPhone, iPad, Android, 3G mobile",
backup: "USB, Network",
videoout: "HDMI, VGA",
},
{
cat: 1,
_id: "sh3-04u",
imageUrl: "img/products/sh3-04u-1.png",
name: "SH3-04U (4ch)",
brand: "SNM",
type: "HD-SDI",
channel: 4,
remote: "LAN, ie, iPhone, iPad, Android, 3G mobile",
backup: "USB, Network",
videoout: "HDMI, VGA, BNC",
},
{
cat: 1,
_id: "d-rhe-828-j",
imageUrl: "img/products/rhe-828-j.png",
name: "RHE-828-J (8ch Compact)",
brand: "iCATCH",
type: "HD-SDI",
channel: 8,
remote: "LAN, ie, iPhone, iPad, Android, 3G mobile",
backup: "Network, USB 2.0 or SATA",
videoout: "HDMI, VGA, BNC",
},
];
class BaseProductDeleteComponent extends React.Component {
constructor(props) {
super(props);
this.deleteItem = this.deleteItem.bind(this);
}
deleteItem() {
alert("delete " + this.props.rowData.name);
console.log(this.props.rowData, this.props.tdData);
}
render() {
return (
<td>
<input
type="button"
className="btn btn-danger"
value="Delete"
onClick={this.deleteItem}
/>
</td>
);
}
}
function ProductTblImgpreloader() {
return <div className="loading-div" style={{ minHeight: "100px" }} />;
}
const TblImageLoader = (props) => (
<ImageLoader
src={props.data}
wrapper={React.DOM.div}
preloader={ProductTblImgpreloader}
>
NOT FOUND
</ImageLoader>
);
const BaseProductTblImageComponent = (props) => {
return (
<td
style={{
width: "170px",
minWidth: "170px",
backgroundColor: "#fff",
}}
>
<a href={props.rowData.imageUrl} target="_blank">
<TblImageLoader data={props.rowData.imageUrl} />
</a>
</td>
);
};
class BaseProductEditComponent extends React.Component {
constructor(props) {
super(props);
this.editItem = this.editItem.bind(this);
}
editItem() {
alert("edit " + this.props.rowData.name);
console.log(this.props.rowData, this.props.tdData);
}
render() {
return (
<td>
<input
type="button"
className="btn btn-warning"
value="Edit"
onClick={this.editItem}
/>
</td>
);
}
}
const ProductsTblPage = (props) => {
let col = [
"imageUrl",
"name",
"brand",
"type",
"channel",
"remote",
"backup",
"HDD",
"videoout",
"delete",
"edit",
];
let tHead = [
"Image",
"Model",
"Brand",
"Type",
"Channel",
"Remote",
"Backup",
"HDD",
"Video output",
"Delete",
"Edit",
];
return (
<SortableTbl
tblData={MyData}
tHead={tHead}
customTd={[
{ custd: BaseProductTblImageComponent, keyItem: "imageUrl" },
{ custd: BaseProductEditComponent, keyItem: "edit" },
{ custd: BaseProductDeleteComponent, keyItem: "delete" },
]}
dKey={col}
/>
);
};
ProductsTblPage.propTypes = {};
ReactDOM.render(<ProductsTblPage />, document.getElementById("app"));
tblData
: Array
tHead
: Array
paging
: boolean, default true
search
: boolean, default true
defaultCSS
: boolean, default true
customTd
: Array
tdData
rowData
field
dKey
: Array
git clone https://github.com/Grace951/react-table.git
cd example/example2
npm install
npm run dev
Then open localhost:3100
in a browser.
MIT
FAQs
simple react sortable searchable table
The npm package react-sort-search-table receives a total of 22 weekly downloads. As such, react-sort-search-table popularity was classified as not popular.
We found that react-sort-search-table demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.