Curl Global Community

Full Version: グリッド行選択について
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
グリッド行の複数行を選択したときにCTRLキーを押しながら選択すると思いますが
CTRLキーを押さないまま複数行を選択することが可能でしょうか?

意図:CTRLキーを押したまま複数行を選択した場合、CTRLキー押すのを忘れて別行を選んだ時
選択した行が解除されるため。

FYI:現在全選択チェックボックスは設けております。

この変更でどうでしょうか?

PHP Code:
{define-class public SwichSelectRecordgrid {inherits RecordGrid}
  
field private switch-selection?:bool false
  
{constructor public {default switch-selection?:bool=false, ...}
    
set self.switch-selection? = switch-selection?
    {
construct-super {splice ...}}
  }

  {
method public {select-record
                     index
:int,
                     
additive?:bool false
                 
}:void
    
|| new behavior
    
{if self.switch-selection?  then
        
{if {self.selection.contains-recordindexthen
            
{self.deselect-record index}
         else
            {
super.select-record
                index

                
additive? = true
            
}
        }
        
     || default 
behavior
     
else
        {
super.select-record index
            
additive? = additive?
        }
    }
    
  }