+ private function allowForEdit(event:DataGridEvent):void {
+ /* check before editing the tag grid that it's neither created_by nor version tags */
+ var item:Object = ((event.currentTarget as DataGrid).dataProvider as ArrayCollection)[event.rowIndex];
+ if(item.k == 'created_by' || item.k == 'version') {
+ event.preventDefault();
+ }
+ }
+
+ private function verifyInput(event:DataGridEvent):void {
+ /* check before saving any change that the new key isn't created_by nor version */
+ // it is OK if the user cancels the edit
+ if( event.reason == DataGridEventReason.CANCELLED ) return;
+
+ var editor:TextInput = (event.currentTarget as DataGrid).itemEditorInstance as TextInput;
+
+ if( event.dataField == "k" ) {
+ if( editor.text == 'created_by' || editor.text == 'version' ) {
+ event.preventDefault();
+ }
+ }
+ }
+