# Deleting records from dataset locking up page

**URL:** <https://forum.inductiveautomation.com/t/deleting-records-from-dataset-locking-up-page/12769>\
**Category:** Ignition\
**Created:** [March 9, 2017, 4:12pm UTC](https://forum.inductiveautomation.com/t/deleting-records-from-dataset-locking-up-page/12769 "2017-03-09T16:12:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerry101](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jerry101](https://forum.inductiveautomation.com/u/jerry101)\
**Post date:** [March 9, 2017, 4:12pm UTC](https://forum.inductiveautomation.com/t/deleting-records-from-dataset-locking-up-page/12769/1 "2017-03-09T16:12:27Z")

</div>

I have two tables on a page and based off the selection of table ‘A’ I retrieve some data and then I need to filter the data for table ‘B’. I am doing so with the following code on ‘PropertyChange’ but after a selection or two on table ‘A’ the page becomes useless and freezes for a very long time. With the code removed the page works fine. Any suggestions?

I do not have access to modify the stored procedure that calls for the data of table ‘B’ that is why i am trying to filter on my side.

```auto
table = event.source.parent.getComponent('B')
data = table.data
unwanted = []

if data.rowCount > 0:
	for row in range(data.rowCount):
		if data.getValueAt(row, "ItemType")=="02":
			unwanted.append(row)

	newData = system.dataset.deleteRows(data, unwanted)
	table.data = newData
```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 9, 2017, 6:37pm UTC](https://forum.inductiveautomation.com/t/deleting-records-from-dataset-locking-up-page/12769/2 "2017-03-09T18:37:13Z")

</div>

First, I don’t see an ‘if’ block in your procedure checking the whether the event is for the ‘data’ property. Look at the example in the [manual](https://docs.inductiveautomation.com/display/DOC/Component+Event+Handlers) for the propertyChange event. That’s vital to prevent lock-ups. For similar reasons, you must never write back to the same property in a propertyChange event. That makes an infinite loop of events on that property. You need to bind your stored procedure to a custom property of type ‘Dataset’, monitor for its changes, and write to the Table ‘B’ .data property with the filtered content.

---

<div class="post-metadata">

**Author:** ![jerry101](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jerry101](https://forum.inductiveautomation.com/u/jerry101)\
**Post date:** [March 9, 2017, 7:08pm UTC](https://forum.inductiveautomation.com/t/deleting-records-from-dataset-locking-up-page/12769/3 "2017-03-09T19:08:08Z")

</div>

Thank you, thank you! been fighting this for two days. Totally makes since to me now and is working great!
