EasyUI Forum
May 05, 2024, 12:56:37 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 [4]
46  General Category / EasyUI for jQuery / getEditor and getEditors always returning NULL on: November 25, 2015, 12:21:36 PM
I loop trough datagrid and need to read values from combobox field = TAGESKENNUNG with typeid and typename in editor defined. But all I get is the value which is contained in the rows object itself, but how to access typeid and typename for a row?
 
  rows = $('#dg').datagrid('getRows');
    for(var i=0; i<rows.length; i++)
    {
       // works fine
       $('#dg').datagrid('getRows').TAGESKENNUNG;

      // any of below 2 lines DOES NOT WORK
       var editors = $('#dg').datagrid('getEditors', i);
       var ed = $('#dg').datagrid('getEditor', {index: i, field:'TAGESKENNUNG'});

     // actually I need to access and maybe write back later the two fields typeid and typename of TAGESKENNUNG
    }

PLEASE PLEASE HELP and THANK YOU a lot in advance!

47  General Category / EasyUI for jQuery / Re: Problem SPECIAL CHARS in datagrid on: August 05, 2015, 03:25:57 PM
Thx for help.
Unfortunately this does not solve the problem as the special chars appear different in various locatinos.

F.e. they are fine in datagrid after loading.
They are also fine in combobox/editor but when I select value then I get mixed up text displayed.

Also it depend how you encode on PHP side and decode on JS side (when loading data) or
vice versa how you encode on JS (for insert/update) and decode on PHP side for the SQL execution.

Any rules what PHP/JS functions to use that work with datagrid and editors/combobox/textbox etc?

It is such a great framework where I have such big and functional application now and I really get stuck on this stupid matter only.
Appreciate your kind help again.
Thx in advance!

BR Mike.
48  General Category / EasyUI for jQuery / Problem SPECIAL CHARS in datagrid on: August 04, 2015, 07:51:24 AM
Gents, pls need your help!
I appreciate the whole easyUI toolbox and got it functional fast and in depth with the perfect doc available online.

BUT one annoying point for me which prevents me from full happiness is the lack of clarity for SPECIAL CHARACTERS.

Please advise what to do on serverside PHP on what to do on javascript for datagrid data side for properly data masking.

(PS: in mysql the data is fine)

I have to deal with special German chars like ÄÜÖäüöß etc but the problem is also in general as I get the data
also messed up with spaces and other normal special chars. CAN I RUN ONE FUNCTION in php and JS before load
that can HANDLE ALL THE CODING and ENCODING in one central place each?

Among thousand other attemps I tried the below ones in PHP and javascript:

PHP
Code:
function umlaute($text)
{
    $returnvalue="";
    for($i=0;$i<strlen($text);$i++){
        $teil=hexdec(rawurlencode(substr($text, $i, 1)));
        if($teil<32||$teil>1114111){
            $returnvalue.=substr($text, $i, 1);
        }else{
            $returnvalue.="&#".$teil.";";
        }
    }
    return $returnvalue;
}


JS
Code:
  function mydecode(str) 
  {
    var dummy = document.createElement('textarea');
    dummy.innerHTML = str;
    return dummy.value;         
  }


Thanks for your help.

PS: maybe an entry in the doc for this topic to clarify once and for all would be appreciated as well.
49  General Category / EasyUI for jQuery / Re: Combobox PROBLEM DISPLAY VALUE/TEXT (Loaded Values are OK) on: July 28, 2015, 03:08:25 AM
FIRST OF ALL - Your loadFilter WORKS like a charm, THX A LOT!


Just for better understanding and consequent future use to avoid problems:

I tried your first proposed solution and actually my data gets masked on php side.
If I dont mask it then it is not displayed at all in combobox - appearance then is a smaller sized blanc row when opening the combobox (u may try "Geschäftsfälle").
For that I use :

Code (sorry dont know how to insert elegantly like your tagged code):
       
        //PHP Code:
        while($row = mysqli_fetch_assoc($result))
        {
            $row['projectid']=      $row['ID'];
            $row['projectname']=    umlaute($row['NAME']);
            $row_set[] = $row;
        }
     
       function umlaute($text)
      {
          $returnvalue="";
          for($i=0;$i<strlen($text);$i++){
              $teil=hexdec(rawurlencode(substr($text, $i, 1)));
              if($teil<32||$teil>1114111){
                  $returnvalue.=substr($text, $i, 1);
              }else{
                  $returnvalue.="&#".$teil.";";
              }
          }
          return $returnvalue;
      }

      // client/javascript - I use for decoding - which works fine but I just DID NOT COMBINE IT WITH LOADFILTER
      function mrrdecode(str)
      {
        var dummy = document.createElement('textarea');
        dummy.innerHTML = str;
        return dummy.value;         
      }


Accordingly if I open the url stated url:'http://www.rannacher.com/_subdomain/engineers4you/includes/BO/load_existing_projects.php?mandant=HHMZT'
I DONT get any of these special chars, like you printed. FFirst things I tested when debugging. Not in chrome not in IE etc.Huh
Any idea?
50  General Category / EasyUI for jQuery / Combobox PROBLEM DISPLAY VALUE/TEXT (Loaded Values are OK) on: July 27, 2015, 03:11:37 AM
Please help, I dont get the combobox to display the selected value correctly.
See attached screenshot!
When open all is fine, but the moment you select a value it has the special chars again.

And thats regardless of what I do in the combobox

                    <th data-options="field:'projectid',width:225,
                            formatter:function(value,row){
                                var projectnamedecoded = mrrdecode(row.projectname);
                                row.projectname = projectnamedecoded;
                                //alert('formatter\n value=['+ value +']\n row='+ JSON.stringify(row) +']\n row.projectname='+row.projectname+']');
                                return row.projectname;   
                            },
                            editor:{
                                type:'combobox',
                                options:{                                                                                           
                                    valueField:'projectid',
                                    textField:'projectname',
                                    method:'get',
                                    url:'http://www.rannacher.com/_subdomain/engineers4you/includes/BO/load_existing_projects.php?mandant=HHMZT',
                                    required:true,
                                    onSelect: function(row){
                                        var projectnamedecoded = mrrdecode(row.projectname);
                                        row.projectname = projectnamedecoded;
                                        //$(this).combobox('setValue', row.projectname );
                                        return row;
                                    },
                                    onChange: function(row)
                                    {
                                      //alert('onChange Combo'+row);
                                    }
                                }
                            }">Projekt</th>

Please help me. Thx in advance!
51  General Category / EasyUI for jQuery / Re: Combobox and special chars on: July 27, 2015, 02:34:07 AM
ANY HELP??? Pleazzzze!
52  General Category / EasyUI for jQuery / Combobox and special chars on: July 23, 2015, 01:13:32 AM
Gents, Ladies,

pls help - very strange phenomen... I am using datagrid with combobox, serverside php for data retrieval from mysql DB.

Now the DB has and stores correctly special chars like the German the öäüß etc.
Data retrieval via php script to the combobox also works fine, but in order to that the values with special chars are getting displayed
in the combobox I have to mask the rows/fields fetched serverside for which I use below function umlaute()

DATA FETCHING
   while($row = mysqli_fetch_assoc($result))
        {
            $row['projectid']=      $row['ID'];
            $row['projectname']=    umlaute($row['NAME']);
            $row_set[] = $row;
        }
    echo json_encode($row_set);

MASKING
function umlaute($text)
{
    $returnvalue="";
    for($i=0;$i<strlen($text);$i++){
        $teil=hexdec(rawurlencode(substr($text, $i, 1)));
        if($teil<32||$teil>1114111){
            $returnvalue.=substr($text, $i, 1);
        }else{
            $returnvalue.="&#".$teil.";";
        }
    }
    return $returnvalue;
}

SO, NOW THE PROBLEM:
With this I see all the values (projectname) and they are correctly displayed in the combobox selection when it is opened.
f.e. in the list I see "Diverse Geschäftsfälle" which is as it should be.

BUT and there are 2 BUTs
--> when I select the value from the open combobox then the selcted value becomes "15002-Diverse&#32;Gesch&#228;ftsf&#228;lle" which is displayed after ot is closed.
--> and when datagrid opens after datagrid populate/select and this value is stored in DB then nothing at all is displayed

PLEASE HELP and
THX in ADVANCE!

Pages: 1 2 3 [4]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!