Jump to content

Sherzod

Moderators
  • Posts

    19833
  • Joined

  • Last visited

  • Days Won

    645

Posts posted by Sherzod

  1. Olá, pessoal!

     

    Estou usando o dbgrid e quando clico na célula para editar, observei que ele não vem selecionado o conteúdo para editar, o cursor vem no final do texto, será que teria como vim com o texto selecionado?

     

    Olá Kalvaitir.

     

    (Traduzido por Traduz Google)

     

    Se eu entendi a pergunta.

     

    1. Se você não usar "columns.editor", então você pode:

     

    UniDBGrid1 -> ClientEvents -> ExtEvents -> adicionar reconfigure:

    function reconfigure(sender, store, columns, oldStore, the, eOpts)
    {
      columns[1].editor = {selectOnFocus: true};    
      
      // for all columns
      for (var i = 0; i < columns.length; i++) {
        columns[i].editor = {selectOnFocus: true};
      }
    }

    2. Se você usar "columns.editor", então você pode:

     

    Por exemplo, as columns [1].editor = UniEdit1;

     

    UniEdit1 -> ClientEvents -> ExtEvents -> adicionar focus:

    function focus(sender, the, eOpts)
    {
      sender.selectText()
    }

    Experimente...

     

    Atenciosamente.

    • Upvote 2
  2. Hi erdal.

     

    use typeAhead... 

     

    UniComboBox1 -> ClientEvents -> UniEvents -> [Ext.form.field.ComboBox] add.

    function beforeInit(sender)
    {
      sender.typeAhead = true;
    }

    autocomplete - if the value of a single.

     

    try...

     

    Best regards.

    • Upvote 2
  3. Hi Erich. 

     

    Error shows or? 

     

    I think firstly you need to add is not in CustomCSS, add in CustomFiles. 

    Secondly, I added the script, but there shows an error "Could not decode media resource data: audio / wav; base64, / / ​​uQRAAAAW ..." 

     

    Maybe better way to use, so:

    var snd = new Audio("file.wav");
    snd.play();


    Best regards.

  4. Hi Eduardo. 
     
     
    Hide: 
    procedure TMainForm.UniFormCreate(Sender: TObject);
    begin
      UniSession.AddJS(UniScrollBox1.JSName + '.setBodyStyle("overflowY:hidden !important");');
    end;
    
    Show: 
    UniSession.AddJS(UniScrollBox1.JSName + '.setBodyStyle("overflowY:auto");');
    

    Try...

     
    Best regards.
  5. Hi Erich. 
     
    Scrollbox position relative to what?
     

    If relative to the screen it is possible as follows:

    scrollbox.jsname + '.getX()'
    scrollbox.jsname + '.getY()'

     

     

    Sorry scroll position:

    scrollbox.jsname + '.body.dom.scrollTop'   //Y
    scrollbox.jsname + '.body.dom.scrollLeft'  //X

    Best regards.

  6. Hi wxb_km. 
     
    Basically, your question should be solved as follows: 

     

    1. Need to use the function 

    cellclick(sender, metaData, td, cellIndex, record, tr, rowIndex, e, eOpts)

    2. Here cellIndex - is the column index and rowIndex - the index of the row. http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.View-event-cellclick

     

    3. And use it to get the value:

    sender.store.getAt(rowIndex).get(cellIndex)

    i.e.:

    function cellclick(sender, metaData, td, cellIndex, record, tr, rowIndex, e, eOpts)
    {  
      alert(sender.store.getAt(rowIndex).get(cellIndex));
    } 
    But in my case (I use UniGUI 0.94.0.1023, under certain circumstances), I think some of the variables swapped
    For me works if I do so:
    function cellclick(sender, metaData, td, cellIndex, record, tr, rowIndex, e, eOpts)
    { 
      alert(sender.store.getAt(tr).get(td));
    } 
    

    Try...

     

    Best regards.

    • Upvote 1
  7. How to store other languages (unicode) in cookies and get it back again
    var cookieValue = document.getElementsByTagName('input')[0].value;
    document.cookie = "lboxcook=" + encodeURIComponent(cookieValue);
    
    function get_cookie(cookie_name) {
    var results = document.cookie.match ('(^| ?' + cookie_name + '=([^;]*)(;|$)');
    return results ? decodeURIComponent(results[2]) : null;
    }
    Farshad, I think in the future, by default, you can use this approach when saving cookies
     
    Sincerely.

     

    • Upvote 2
  8. JS:window.close();

     

    This method is only allowed to be called for windows that were opened by a script using the window.open method. If the window was not opened by a script, the following error appears in the JavaScript Console: Scripts may not close windows that were not opened by script.

     

    https://developer.mozilla.org/en-US/docs/Web/API/window.close

     

    If you are using Mozilla Firefox, enter in the about:config and modify dom.allow_scripts_to_close_windows property to true, then you can use window.close()

    ...

  9. Hi Farshad.
    Hi perjanbr.
     
    Thank you for your answers! 
     
    Sorry, but I understood the question Fenix otherwise ... ​​, 
    ie how to create a custom user-defined function with callback? 
    Is it possible? 
     
    for example: 
     
    after the completion of a certain function, the function calls another callback function.
     
    Sorry if I was not able to to explain the essence of my question, and if the question is not correct...

     

     
    Sincerely.

     

  10. 1. UniRadioButton1.Font.Color := $E7D8CC

     

    2. I think there is a bug when using the "UniDBNavigator1.Enabled: = ..." 

     
    Use it: 
     
    disabled
    UniSession.AddJS(UniDBNavigator1.JSName + '.setDisabled(true)');

    enabled

    UniSession.AddJS(UniDBNavigator1.JSName + '.setDisabled(false)');
    Sincerely.
  11. Hi Erich. 
     
    I think there need to add little time delay and use javascript   

     

    Try:

        aktuell_uniCanvas:=TuniCanvas.Create(self);
        aktuell_uniCanvas.Parent:=aktuell_panel;
        aktuell_uniCanvas.Left:=1;
        aktuell_uniCanvas.Top:=1;
        aktuell_uniCanvas.Width:=20;
        aktuell_uniCanvas.Height:=20;
        aktuell_uniCanvas.Pen.Color := clred;
        aktuell_uniCanvas.Brush.Color := clred;    
        
        //code below does not have time, but can be used anywhere in the code after creating canvas   
        //aktuell_uniCanvas.Cirlcle(1,1,10);   
        
        //use   
        UniSession.AddJS('setTimeout('''+ aktuell_uniCanvas.JSName + '.circle(1,1,10)'', 50);');
    Rectangle:
    aktuell_uniCanvas.Rectangle(10,10,100,100);
    =
    UniSession.AddJS('setTimeout('''+ aktuell_uniCanvas.JSName + '.rect(10,10,110,110)'', 50);');
    
    ... 
    Sincerely.
  12. And so you can change the value of combobox, try

     

    UniDBGrid1 -> ClientEvents -> ExtEvents -> add function sortchange:

    function sortchange(ct, column, direction, eOpts)
    {
      Ext.getCmp(MainForm.UniComboBox1.id).select(Ext.getCmp(MainForm.UniComboBox1.id).getStore().getAt(column.dataIndex));
    }

    Best regards.

×
×
  • Create New...