Facility Control

 View Only
  • 1.  Drag and Drop in dashboard

    Posted 08-15-2021 22:36
    Hi:

    I want the drag label to be in the format shown in the figure below. I want two different DRAG objects to assign different values to the drop object, and instead of writing two ogScript tags, I want to be able to identify the specific DRAG object ID and return different values between "drag" and "drop". Is there an event that does this?

    PS: The event attribute in dashboard is not found in the help document where I should look for it.



    <abs gridsize="20" keepalive="true">
       <label height="60" left="40" name="Drag and Drop Examples" style="txt-align:west;size:Bigger;" top="40" width="620"/>
       <label height="20" left="40" name="Drag and drop is handled by using ogscript blocks that handle &quot;dragvalue&quot; and &quot;ondrop&quot; events, with specific targets." style="txt-align:west;" top="100" width="1100"/>
       <label height="20" left="40" name="Look at the two &quot;ogscript&quot; blocks in this panel for examples." style="txt-align:west;" top="120" width="1120"/>
       <label height="100" id="dragspot1" left="120" name="DRAG ME 1" style="txt-align:center;bdr:round;bg#selectbg;" top="260" width="100"/>
       <label height="320" id="dropspot" left="320" name="Drop it here!" right="2580" style="size:Big;bg#dark;txt-align:center;bdr:etched;" top="240"/>
       <ogscript handles="dragvalue" targetid="dragspot1,dragspot2">return 'drag1';</ogscript>
       <ogscript handles="ondrop" targetid="dropspot">ogscript.rename('dropspot', 'Dropped: "' + event.dropData + '"');</ogscript>
       <label height="100" id="dragspot2" left="120" name="DRAG ME 2" style="txt-align:center;bdr:round;bg#selectbg;" top="400" width="100"/>
    </abs>
    ​


    ------------------------------
    Ding YouXing
    ------------------------------


  • 2.  RE: Drag and Drop in dashboard

    Posted 08-16-2021 11:45
    Hi Ding,

    You can use dragvalue attributes that can return basically the dragids here.
    Please find the attached code for the panel.
    <abs gridsize="20" keepalive="true">
       <label height="60" left="40" name="Drag and Drop Examples" style="txt-align:west;size:Bigger;" top="40" width="620"/>
       <label height="20" left="40" name="Drag and drop is handled by using ogscript blocks that handle &quot;dragvalue&quot; and &quot;ondrop&quot; events, with specific targets." style="txt-align:west;" top="100" width="1100"/>
       <label height="20" left="40" name="Look at the two &quot;ogscript&quot; blocks in this panel for examples." style="txt-align:west;" top="120" width="1120"/>
       <label dragvalue="return 'drag1';" height="100" id="dragspot1" left="120" name="DRAG ME 1" style="txt-align:center;bdr:round;bg#selectbg;" top="260" width="100"/>
       <label height="320" id="dropspot" left="320" name="Drop it here!" style="size:Big;bg#dark;txt-align:center;bdr:etched;" top="240" width="200"/>
       <ogscript handles="ondrop" targetid="dropspot">ogscript.rename('dropspot', 'Dropped: "' + event.dropData + '"');</ogscript>
       <label dragvalue="return 'drag2';" height="100" id="dragspot2" left="120" name="DRAG ME 2" style="txt-align:center;bdr:round;bg#selectbg;" top="400" width="100"/>
    </abs>​


    Thanks
    Anand



    ------------------------------
    Anand Soraganvi
    Ross Video
    ------------------------------



  • 3.  RE: Drag and Drop in dashboard

    Posted 08-27-2021 07:40
    It's great! 
    And another question. Could you please tell me other related event properties, such as I can get the id of the object.

    ------------------------------
    Ding YouXing
    ------------------------------



  • 4.  RE: Drag and Drop in dashboard

    Posted 08-30-2021 10:35
    Hi Ding,

    Each type of event has different properties

    There aren't many properties we expose
    Your drop handler knows:
    • isConnectionSettings
    • isFileList
    • x
    • y
    • dropData


    ------------------------------
    Anand Soraganvi
    Ross Video
    ------------------------------