In kendo inline adding feature when i press the add button mulitple times it generates multiple new rows to add.....is there any way to restrict that?? i.e, If a user click the add button multiple times it should only show one row for adding new data.
2 Answers, 1 is accepted
0
Stefan
Telerik team
answered on 20 Nov 2019, 08:47 AM
Hello, Jiyo,
This can be done, by making a check to see if there is a new line added. The check will depend on the implementation.
addNew = () => {
let data = [...this.state.data];
let isNewAdded = false;
data.forEach(item => {
if (!item.ProductID) {
isNewAdded = true;
return;
}
});
if (!isNewAdded) {
const newDataItem = { inEdit: true, Discontinued: false };
this.setState({
data: [newDataItem, ...this.state.data]
});
}
};
Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items