Okay
  Public Ticket #1343736
change float input mask
Closed

Comments

  •  5
    Jottes started the conversation

    How can I change the float input mask to start entering data from the left of the comma/dot?

    Right now if I want to enter '5.0' I have to type '50' because I have set the column to display one decimal place.
    My users will be confused if I use it like this

    See also https://tmsplugins.ticksy.com/ticket/1341279

  •  471
    Isidora replied

    Hi Johannes,
    Thank you for your purchase.

    You don't have to change float input mask, because it should be working like you need. If you enter 5 in decimal column you should get number 5.0(depends of decimal places )

    Can you please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here just check Private Reply so nobody can see them except us.

    Also point me to the table id where you have this issue.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  5
    Jottes replied

    it's a development VM, so I cannot send you a link. I can offer you to take a look using teamviewer in about an hour, if that helps.

  •   Jottes replied privately
  •   Jottes replied privately
  •   Jottes replied privately
  •   Jottes replied privately
  •  471
    Isidora replied

    Hi Johannes,

    Please note that standard item support (as defined by Envato's definition of support) does not include:

    Customization services; 
    Installation services;
    Writing MySQL queries;
    Writing advanced CSS;
    Resolving and debugging third party software and hardware issues;
    Preparing files and tables;
    Skype, Teamviewer calls or etc.
    Support with such requests can be provided on a paid basis.

    Can you please take a screencast of the table, table settings, all tabs in column settings for that column that you set float type and also how inserting that numbers in that column.

    Thank you.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •   Jottes replied privately
  •  471
    Isidora replied

    Hi Johannes,

    You can achieve that using inline editing.  With edit block or Popover edit block that is default behavior of inserting float numbers.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  5
    Jottes replied

    What's the use case for this type of data entry? I don't see how users wouldn't get confused with that. This is absolutely not standard behavior.

    Is there no way to change it?

  •  471
    Isidora replied

    Hi Johannes,

    Many customers request this kind inserting floats in table, so we made like that. You have to make some changes in code and then you will be able to insert floats like you request. In file

    /wp-content/plugins/wpdatatables/assets/js/wpdatatables/wpdatatables.js around line 846 you will find this code:

    $(tableDescription.selector + '_edit_dialog input.wdt-maskmoney[data-column_type="float"]').each(function (i) {    
        var decimalPlaces = tableDescription.columnsDecimalPlaces[$(this).data('key')] != -1 ?        
        tableDescription.columnsDecimalPlaces[$(this).data('key')] :        parseInt(tableDescription.decimalPlaces);    
        $(this).maskMoney({        
            thousands: tableDescription.number_format == 1 ? '.' : ',',        
            decimal: tableDescription.number_format == 1 ? ',' : '.',        
            precision: decimalPlaces,        
            allowNegative: true,        
            allowEmpty: true,        
            allowZero: true    
        })
    });

    and replace with this one:

    $(tableDescription.selector + '_edit_dialog input.wdt-maskmoney[data-column_type="float"]').each(function (i) {        
        var decimalPlaces = tableDescription.columnsDecimalPlaces[$(this).data('key')] != -1 ?            
        tableDescription.columnsDecimalPlaces[$(this).data('key')] :        
        parseInt(tableDescription.decimalPlaces);        
    });

    This will be overwritten in next update so you have to return here and do it again.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  5
    Jottes replied

    Sorry, but I don't notice a different behavior. I replaced the code but nothing changed. Tried deleting browser cache, still the same.

  •  5
    Jottes replied

    Alternatively, if you find a way to add up 'time' values, I'd be happy, too.

    Plus: Is it possible to limit values that are allowed to be entered? E.g. only whole numbers and .5 values (so 2.0, 5.5, 9.5 would be ok but not 9.1, 0.9 and 5.4)

  •   Jottes replied privately
  •  471
    Isidora replied

    Hi Johannes,

    You have to turn off option "Use minified wpDataTables Javascript" on tab "CUSTOM JS AND CSS" in wpdatatable settings.

    "Alternatively, if you find a way to add up 'time' values, I'd be happy, too."

    Sorry but I did not quite understand what are you trying to achieve. Can you please explain me more and send me some example/screenshot so I can give you my suggestion.

    "Plus: Is it possible to limit values that are allowed to be entered? E.g. only whole numbers and .5 values (so 2.0, 5.5, 9.5 would be ok but not 9.1, 0.9 and 5.4)"

    It is possible to set "Editor input type" on Single-value selectbox on "EDITING" tab in column settings and in "Predefined value(s)" you will see only data from table. Unfortunately your request  is not possible with built in features, you have to do some code customization. 

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  5
    Jottes replied

    Hi Milan,

    thank you - the "minified Javascript" switch was the solution.

    Ticket can be closed.