グリッド行選択について

2 件の投稿

グリッド行の複数行を選択したときに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-record? index} then
            
{self.deselect-record index}
         else
            {
super.select-record
                index
, 
                
additive? = true
            
}
        }
        
     || default 
behavior
     
else
        {
super.select-record index, 
            
additive? = additive?
        }
    }
    
  }
}