3 Replies Latest reply on Jan 5, 2011 7:31 AM by jfb00

    Disable row edit

    jfb00 Level 3

      Hi All,

      I found this:

      http://blog.classsoftware.com/index.cfm/2007/6/11/Flex-Datagrid-Edit-Cell-on-Row-Click

      How can I do the other way around?

      I have a column that is enable for edit but base in some condition I want to disable the edit for entire row in my datagrid.

      Thanks

       

      Johnny

        • 1. Re: Disable row edit
          Flex harUI Adobe Employee

          You can block editing via the ITEM_EDIT_BEGINNING event.

          1 person found this helpful
          • 2. Re: Disable row edit
            jfb00 Level 3

            How Alex?

            I add ITEM_EDIT_BEGINNING event in my advanced datagrid to call a function like:

             

            private function disableRow(event:AdvancedDataGridEvent):void{
               if(event.dataField=="FIELD_03"){
                   var temp:String = event.itemRenderer.data["FIELD_02"]; //Here I capture value of my 2nd column
                   if (temp == "MyCondition")
                      //Here I want to block the editing                    
               }
            }
            

             

            Thanks for your help and reply.

             

            Johnny

            • 3. Re: Disable row edit
              jfb00 Level 3

              I go it.

              private function disableRow(event:AdvancedDataGridEvent):void{
                 if(event.dataField==FIELD_03){
                     var temp:String = event.itemRenderer.data[FIELD_02]; //Here I capture value of my 2nd column
                     if (temp == MyCondition)
                        //Here I want to block the editing
                        event.preventDefault();                    
                 }
              }