EasyUI Forum
April 19, 2024, 11:06:30 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1] 2 3
1  General Category / EasyUI for jQuery / Re: Double-click on date box to enter current date on: April 18, 2023, 06:31:02 AM
I want to do this for all dateboxes, and on double-click, not single click. I tried this code but it doesn't work.
Code:
$('.easyui-datebox').next().on('dblclick', function(){
  if (!($(this).datebox('getValue'))){
    var opts = $(this).datebox('options');
    var value = opts.formatter(new Date());
    $(this).datebox('setValue',value);
  }
})
2  General Category / EasyUI for jQuery / Double-click on date box to enter current date on: April 12, 2023, 12:50:40 PM
Is there a way to enter the current date in a datebox simply by clicking either in the box or on the dropdown arrow?
3  General Category / EasyUI for jQuery / Re: Default century in datebox on: March 29, 2023, 02:10:46 PM
I posted this 5 days ago and haven't had an answer. Can you please reply? Thanks.

I have dateboxes using US format (MM/DD/YYYY). If the user doesn't use the calendar, and types in the year as 2 digits, it defaults to 20th century dates (1923 instead of 2023). This seems like a bug. Can it be fixed?
4  General Category / EasyUI for jQuery / Default century in datebox on: March 24, 2023, 08:39:42 AM
I have dateboxes using US format (MM/DD/YYYY). If the user doesn't use the calendar, and types in the year as 2 digits, it defaults to 20th century dates (1923 instead of 2023). This seems like a bug. Can it be fixed?
5  General Category / EasyUI for jQuery / Filter function on numberbox on: March 19, 2023, 07:43:01 AM
Please refer to this discussion in which I asked how to disable the decimal point in a numberbox.
https://www.jeasyui.com/forum/index.php?topic=8479.0

I just discovered that on numberboxes where I use the code you provided, the getValue method no longer works when the value is changed.. Even after the change, getValue still returns the old value. I have to use getText instead.

Can you explain the difference between getValue and getText for numberboxes? They always seem to return the same thing so I don't understand why getValue even exists.


6  General Category / EasyUI for jQuery / Re: Code to add key handler works in developer console, not when included in page on: March 05, 2023, 10:34:20 PM
Your code didn't work and I figured out that it wasn't correct. You have the "extend" twice, and substituted "combo" for "datebox". I changed it to the following and it did work.

Code:
    $.extend($.fn.datebox.defaults.keyHandler, {
      up: function (e) {
        var d = $(e.data.target);
        var d1 = moment(d.datebox('getText')).add(1, 'days');
        var d2 = d1.format('MM/DD/YYYY');
        d.datebox('setValue', d2);
      },
      down: function (e) {
        var d = $(e.data.target);
        var d1 = moment(d.datebox('getText')).add(-1, 'days');
        var d2 = d1.format('MM/DD/YYYY');
        d.datebox('setValue', d2);
      }
    })
7  General Category / EasyUI for jQuery / Code to add key handler works in developer console, not when included in page on: March 05, 2023, 05:33:26 PM
I created this function to add a key handler to dateboxes that will increment /decrement the date when the up or down arrows are pressed. This code works when I enter it in the developer console after loading the page, but not when I include it in the page. I tried including it in the document.ready function and then placing it at the bottom of the page but it doesn't work either way - it does nothing. Where do I need to put this in order for it to work?

Also, when figuring out how to do this, I found that in this code, $(this) returns the textbox that EasyUI creates internally, not the actual datebox component, and therefore it's necessary to use val() rather than getText or setText. Is there a way to get the datebox component here? It's not really important but would make the code more understandable.

Code:
  $('.easyui-datebox').datebox({
    inputEvents:$.extend({},$.fn.datebox.defaults.inputEvents,{
      keyup:function(e){
        if ((e.which == 38) || (e.which==40)){
          var days=(e.which==38) ? 1 : -1;
          var d1 = moment($(this).val()).add(days, 'days');   // uses moment.js date library
          var d2 =d1.format('MM/DD/YYYY');
          $(this).val(d2);
        }
      }
    })
  })
8  General Category / EasyUI for jQuery / Validate numberbox on: February 20, 2023, 09:00:35 AM
I have some numberboxes where I don't want to allow them to be blank. If the user erases the field, I want to enter "0.00", and I want this to happen on the blur event without any message displaying. This will only apply to numberboxes containing a specific class name. I can't figure out how to use validation to do this. Please give me some sample code for this purpose. Thanks.
9  General Category / EasyUI for jQuery / Re: Problem with combobox getValue on: February 08, 2023, 09:44:32 PM
The text is not being modified manually. I'm simply selecting it by clicking on the list, and limitToList is set to true.

I really can't figure out what's happening here. It's actually happening on two different comboboxes, but I have others, also populated from a database, where it works correctly.

Do you have any other ideas?
10  General Category / EasyUI for jQuery / Re: Problem with combobox getValue on: February 08, 2023, 12:27:53 PM
Yes, that is data format from the server. Here it is.
Code:
[ { "code": "", "name": ""},{ "code": "A1", "name": "A1 - COMFORTLITE EVA"},{ "code": "A3", "name": "A3 - SOFTFIT - EVA"},
{ "code": "A4", "name": "A4 - SOFTFIT - PORON"},{ "code": "A5", "name": "A5 - SOFTFIT - CORK"},
{ "code": "A6", "name": "A6 - COMFORTLITE PORON"},{ "code": "A7", "name": "A7 - COMFORTLITE CORK"},
{ "code": "C6", "name": "C6 - CORK UNIBODY"},{ "code": "C7", "name": "C7 - CORK DUAL DENSITY"},
{ "code": "D1", "name": "D1 - DRESSFIT"},{ "code": "D2", "name": "D2 - SLIM-FIT"},{ "code": "D4", "name": "D4 - CASUALFIT"},
{ "code": "D5", "name": "D5 - CASUALFIT PLUS"},{ "code": "DL", "name": "DL - DIABETICFIT FLEXIBLE"},
{ "code": "DR", "name": "DR - DIABETICFIT RIGID"},{ "code": "F1", "name": "F1 - THE CONTROLLER"},
{ "code": "F2", "name": "F2 - UCBL"},{ "code": "F3", "name": "F3 - GAIT PLATE - Correct Intoe"},
{ "code": "F4", "name": "F4 - GAIT PLATE - Correct Outoe"},{ "code": "F5", "name": "F5 - ADULT CONTROLLER"},
{ "code": "F6", "name": "F6 - ADULT UCBL"},{ "code": "L1", "name": "L1 - LEATHER LAMINATE"},
{ "code": "L2", "name": "L2 - LEATHER CORK"},{ "code": "L3", "name": "L3 - LEATHER EVA"},
{ "code": "L5", "name": "L5 - LEATHER PORON"},{ "code": "L6", "name": "L6 - LEATHER SHAFFER"},
{ "code": "L7", "name": "L7 - LEATHER BALANCER "},{ "code": "S1", "name": "S1 - SPORTFIT 3mm"},
{ "code": "S10", "name": "S10 - SPORTFIT 4mm"},{ "code": "S2", "name": "S2 - SPORTFIT PLUS"},
{ "code": "S3", "name": "S3 - COMFORTFLEX"},{ "code": "S4", "name": "S4 - GRAPHLITE I - Moderate"},
{ "code": "S5", "name": "S5 - GRAPHLITE II - Semi-Rigid"},{ "code": "S6", "name": "S6 - GRAPHLITE III - Rigid"},
{ "code": "S7", "name": "S7 - SPORTFIT FLEX"}]

I found that this problem actually occurs in two of the three functions where I use this combobox. In the other one the 'getValue' works correctly. Here is a screen shot showing the result when it works correctly, which as you can see is different from the previous screen shot.

Can you tell me any possible reason why this would happen? I've tested this a lot and can't figure it out.
11  General Category / EasyUI for jQuery / Problem with combobox getValue on: February 03, 2023, 08:36:17 AM
I am using a combobox populated from a database using this code. So when I use the 'getValue' method I assume I should get the valueField, not the textField. But I am getting the textField and can't seem to find any way to get the valueField.
Code:
<INPUT class='easyui-combobox' ID='selMaterial' editable=false label='Material' labelWidth=80 style='width: 350px'
   data-options="valueField: 'code', textField: 'name', method: 'get', url: 'sql_main.php?proc=get_materials_select'">
This shows the data in the combobox, using the 'getData' method.


And this shows the result of 'getValue' which is actually the same as 'getText'). Why is 'getValue' returning the valueField?
12  General Category / EasyUI for jQuery / Re: Combobox scroll on select on: January 30, 2023, 08:18:35 AM
This works as a standalone but doesn't work on my page. My combobox is populated from a database using a url so maybe that makes a difference somehow.

Anyway, why didn't you mention the scrollTo method before, since that was my basic problem? This method isn't listed in the documentation at all. Are there other methods/properties/events that are undocumented??
13  General Category / EasyUI for jQuery / Re: Combobox scroll on select on: January 29, 2023, 10:40:01 AM
I put this function at the bottom of my page after all the HTML code, but it never executes. I added a console.log statement to see if it was executing and nothing was logged.

Anyway, as far as I can tell this function won't fix the problem, which is that the combobox doesn't scroll so that the selected item is visible. Using setValue doesn't do this scrolling. Is there a way to make that happen? The combobox really needs to have a method to make a specific item visible.
14  General Category / EasyUI for jQuery / Combobox scroll on select - SECOND POST, PLEASE ANSWER on: January 27, 2023, 06:41:53 AM
Can you please answer my previous post "Combobox scroll on select" from a couple of days ago? I see you have answered more recent posts but have not answered this one. Thank you.
15  General Category / EasyUI for jQuery / Combobox scroll on select on: January 25, 2023, 11:09:14 AM
I have a combobox populated from a database table. It has values like A1,A2,A3,C1,C2,C3,S1,S2,S3, etc. The user wants to be able to press a letter key (A,C,S, etc.) and have it jump to the first value beginning with that letter. By using this code I am able to get it to select that value. The problem is that if the value is not in the visible portion of the list, it won't scroll to that value to make it visible. Is there a way to do that?

Code:
  $('#selOrthotic').combobox('textbox').bind('keypress', (function(e) {
    var k=String.fromCharCode(e.which).toUpperCase();
    for (c of $('#selOrthotic').combobox('getData')) {
      // 'code' is the database field name of the value field
      if (c.code.slice(0,1)==k) {
        $('#selOrthotic').combobox('select', c.code);
        break;
      }
    }
  }))
Pages: [1] 2 3
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!