How can table cell data entry be restricted to numeric only?

How can I restrict table cell data entry to numeric value (and backspace / delete / . / + / -) only? There is no customizer available. (Ignition 8.0.)

Do I have to script in the keyPressed or keyTyped event? It seems like something that should be built-in.

Why is no customizer available?

Aside from that, in tricky cases, you can generate custom cell editors for the Power Table. These posts cover many cases:

Sorry, Paul. I worded that badly.

The table customizer is available but has no options for “numeric only” or keypress filtering.

I had already had a good look through the forum and web search but didn’t find an answer.

Thank you.

Psst! Phil not Paul

Perhaps check out RegEx

Sorry, Phil, for the misnomer. (I remembered the first and last letters only.)

I solved the problem as follows. Note that I only want column 2 to be editable.

  • On the Power Table scripting editor enable the isCellEditable extension function. Add in:
	if colIndex == 2: 
		return True
		return False
  • Enable the onCellEdited extension function and add in something like this:
	errMsg = ''

		# Test if newValue is a valid float.
		newValue = float(newValue)
	except ValueError:
		errMsg = 'Invalid number value entered: ' + str(newValue)  

	if errMsg <> '':
		system.gui.messageBox(errMsg, 'Sorry')
        # The oldValue will automatically reappear.
		newData = system.dataset.setValue(, rowIndex, colIndex, str(newValue)) = newData
		# Update the CSV file.	

Now to update the CSV file!