Blox data input to keep the entered value

Comments

6 comments

  • Avatar
    Einav Shuker

    Hi Pawel,

    I'm using CSS to make the placeholder text transparent (just replace the input.date class name from 'Class'. 

    "script": "$('.Class').css('color','transparent');"

    0
    Comment actions Permalink
  • Avatar
    Admin

    Hey Einav,

    But this is not making the Date Picker to preserve the values that have been selected. Think things like that should be covered with no extra scripts needed. I have one for saving values from the filters - so taking FIRST and LAST available values from there and displaying them in the date picker. let me know if anyone needs sth like that.

    Thanks,

    Pawel

    0
    Comment actions Permalink
  • Avatar
    Keerthan Kharvi

    Hi Pawel,

     

    The simplest method is to turn off dashboard filter only for Date Picker widget. Let me know if this works

    -1
    Comment actions Permalink
  • Avatar
    Einav Shuker (Edited )

    Hi Pawel,

    Can you please share such example?

    0
    Comment actions Permalink
  • Avatar
    Zcost Server

    Hi Pawel,

    I did a test as you suggested.

    It works only during selection.

    Once the dashboard is filtered on selected values  (Submit) the selected dates are no more displayed in the input fields. (jj/mm/aaaa).

    Do you have suggestion how to do it ?

     

    Regards,

    Patrice

    0
    Comment actions Permalink
  • Avatar
    Admin

    Hey Patrice,

    I have a script that should work for you:

    widget.on('ready',function(se,ev){

    if (!Array.isArray(se.queryResult)) return;

    var minMax = se.queryResult.reduce(function(acc, val){
    if((!acc.min) || acc.min>val[0].Value){acc.min = val[0].Value}
    if((!acc.max) || acc.max<val[0].Value){acc.max = val[0].Value}
    return acc
    } , {min:undefined,max:undefined})


    formatted_dateFrom = moment(minMax.min).format('YYYY-MM-DD')
    formatted_dateTo = moment(minMax.max).format('YYYY-MM-DD')

    document.getElementById("data.filters[0].filterJaql.from").value=formatted_dateFrom
    document.getElementById("data.filters[0].filterJaql.to").value=formatted_dateTo

    document.getElementById("data.filters[0].filterJaql.from").setAttribute("style", "text-align:center");
    document.getElementById("data.filters[0].filterJaql.to").setAttribute("style", "text-align:center");

    })

    This will pull the values for you.

     

    Thanks,


    Pawel

    0
    Comment actions Permalink

Please sign in to leave a comment.