EasyUI Forum
March 04, 2024, 12:23:05 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 / General Discussion / Extensions version and changes on: January 07, 2021, 04:15:23 AM
This is not my first topic about that. Could you provide, for each published extension, a site page with version number and a change log just like easyui main framework package? At the moment the only way to know if i'm using an old version extension, is waiting an answer from this forum like "Try to download the newest file......". 
2  General Category / Bug Report / TextEditor extension styles issue on: November 12, 2019, 02:17:25 PM
Using texteditor extension with black theme and mobile.css, I noticed some bugs on display style.
First of all the result is not so readable because toolbar icons are dark just like background.
Second, I must use texteditor without header/title (it is inside a form with a defined label); in this case remains some pixel of header row visible (see screenshot).
3  General Category / EasyUI for jQuery / Sidemenu with single items (no submenu) on: September 27, 2019, 08:32:06 AM
I love sidemenu plugin and its behavior on collapse/expand/resize. How can I use it on menu with single items (no submenu)? I need to manage an item (with its icon) directly selectable; I don't want a label which open/expand a submenu with the single item (the actual plugin behavior showed on examples).
You can view the attached image for an example. 
4  General Category / Bug Report / Re: Dark themes with mobile on: September 18, 2019, 05:21:29 AM
Please try to download the themes from https://www.jeasyui.com/extension/themes_basic.php
Thanks. Now it's perfect!
5  General Category / Bug Report / Dark themes with mobile on: September 12, 2019, 02:33:48 AM
EasyUi for Jquery with mobile. Using dark themes ("Black" for example), easyui-navpanel on header and footer show text with dark foreground color; using dark colors for background too, it is not so readable. Waiting for your css correction, for now i'm using a div with "panel-title" class, like this:.
Code:
<div class="easyui-navpanel">
    <header>
        <div class="m-toolbar">
            <div class="panel-title m-title">Welcome on MyApp</div>
        </div>
    </header>
</div>
6  General Category / EasyUI for jQuery / Undo function on texteditor on: May 13, 2019, 08:36:18 AM
I'm trying to extend texteditor with undo function with this code:
Code:
$.extend($.fn.texteditor.defaults.commands, {
        'undo': {
            type: 'linkbutton',
            iconCls: 'icon-undo-bn',
            onClick: function(){
                var disabled = $(this).texteditor('getEditor').dialog('dialog').hasClass('texteditor-disabled');
                var readonly = $(this).texteditor('getEditor').dialog('dialog').hasClass('texteditor-readonly');
                if ((disabled === false) && (readonly === false))  {
                    var t = $(this).texteditor('getEditor');
                    t.focus();
                    t.trigger('mouseup');
                    t.texteditor('execCommand','undo');
                }
            }           
        } 
});
I noticed a strange issue when I use it on a page where there is also a datagrid with "editable datagrid" and/or "datagrid filter row" extensions enabled
In this case I've an undo effect on datagrid textbox fields generated by these extensions
7  General Category / EasyUI for jQuery / Re: texteditor insertContent on: April 22, 2019, 02:11:04 AM
Try this code instead.
Code:
$('#myid').texteditor('getEditor').focus();
$('#myid').texteditor('getEditor').trigger('mouseup');
$('#myid').texteditor('insertContent', '<p>new content</p>');
Thanks. This works.
8  General Category / EasyUI for jQuery / Re: texteditor insertContent on: April 19, 2019, 03:56:30 AM
The 'insertContent' method insert the content to the current position of the editor. So the editor must get focus before calling this method.
I supposed that and tried this immediately after texteditor has been inizialized:
Code:
$('#myid').texteditor('getEditor').focus().select();
$('#myid').texteditor('insertContent',myTxtStr);
but nothing.
I've to manually click with mouse on any position of texteditor and only after that 'insertContent' it'is ok
9  General Category / EasyUI for jQuery / texteditor insertContent on: April 18, 2019, 03:45:25 AM
Anyone hav problem using insertContent method on texteditor extension?
I thought it was a stupid thing: $('#myid').texteditor('insertContent',myTxtStr)
but nothing appears.
Instead $('#myid').texteditor('setValue',myTxtStr) it's fully working.
Why?
10  General Category / General Discussion / Re: Printing - Convert to csv, xls, pdf from datagrid on: May 09, 2018, 11:39:31 PM
Please download a newer version from from https://www.jeasyui.com/extension/downloads/datagrid-export.zip
Wow, I've been waiting for a while this kind of extension. When it will be "official" and then documented? As I wrote on ather post, it could be a good practice on extensions site pages to show a changelog, a version number or at least a "last modified date". It's very difficult for me realize if I'm using the latest version of any extension
11  General Category / EasyUI for jQuery / Re: How to check all fields required are written? on: February 20, 2018, 07:23:41 AM
Are you talking about form fields? If so it'simple; you can try "validate" action of EasyUi form component
12  General Category / General Discussion / Re: Complete program for File upload with FILEBOX on: December 14, 2017, 05:33:20 AM
I hope this can help you.

Html/javascript/EasyUi code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>UPload Example</title>
<!-- Load here all css and libraries for EasyUi -->
</head>
<body>
<form enctype="multipart/form-data" id="ff" name="ff" method="post">
            <table border="0" style="width:100%">
                <tr>
                    <td><input id="fb" name="userfile[]" type="text" style="width: 100%;"></td>
                    <td style="width: 90px; text-align: right;"><a id="btn-upload" href="javascript:void(0)">Upload</a></td>
                </tr>
            </table>
</form>
<div id="multiusage"></div>
<script type="text/javascript">
$(function() {

$('#fb').filebox({
        buttonText: 'Browse...',
        multiple: true,
        icons:[{
            iconCls:'icon-clear',
            handler: function(e){
                $(e.data.target).filebox('clear');
            }
        }],
        onChange: function (newValue, oldValue) {
            if ($(this).textbox('getValue').length > 0 ) {
                $('#btn-upload').linkbutton('enable');
            }
            else { $('#btn-upload').linkbutton('disable'); }
        }
    });
    var inputfile = $('#fb').next().find('.textbox-value');
    $('#btn-upload').linkbutton({
        iconCls: 'icon-upload', disabled: true, plain: true,
        onClick: function() { upLoad(); }
    });
   
    // Function to execute on submit form
    function upLoad() {
        if ($('#fb').textbox('getValue').length === 0) {
            $.messager.alert('Message','Upload not possible.<br /><br />No file selected.','error');
            return false;
        }
        $('#ff').form('submit', {
            url: 'upload-backend.php',
            queryParams: { uploadpath: '/tmp/uploads' },
            iframe: false,
            onProgress: function (percent) {
                progressFile('update',percent);
            },
            onSubmit: function(param) {
                progressFile('show');
            },
            success: function(data) {
                $('ff').form('clear');
                setTimeout(function() {
                    submitReturn(data,function(data) { // nothing to exec on submit success                       
                    },
                    function(){ // nothing to exec on submit error
                    },false);
                },1000); }
});
    }

// Show modal ProgrssBar when uploading file
function progressFile(method,val){
var div_id='win-progress-file';
var progress_id='progress-file';
var htmlcontent = '<div id="'+progress_id+'" class="easyui-progressbar" style="width:100%;"></div>' +
'<div style="margin-top: 10px; text-align: center; font-size: 1.3em; font-weight: bold;">Uploading files</div>';
var op = method.toLowerCase();
switch (op) {
case 'show':
$("#multiusage").append('<div id="'+div_id+'" style="padding: 20px;"></div>');
$("#"+div_id).window({
title: 'Wait ...',
width: 300,
resizable: false, shadow: false,
minimizable: false, maximizable: false, collapsible:false, closable: false,
modal: true,
onClose: function (event, ui) {
$("#"+div_id).window('destroy');
$("#"+div_id).remove();
},
content: htmlcontent
});
break;
case 'close':
$("#"+div_id).window('close');
break;
case 'update':
$("#"+progress_id).progressbar('setValue', val);
break;

}
}

//Manage form submit return message (you can optionally exec specified function on success and on error)
function submitReturn(data,successCallback,errorCallback,showSavemsg) {
showSavemsg = typeof showSavemsg !== 'undefined' ? showSavemsg : true;
$.messager.progress('close');
progressFile('close');
try {
var data = $.parseJSON(data);
} catch (e) {
//        console.log(e);
$.messager.alert('JavaScript Exception Error',data);
errorCallback();
return false;
}
if (data.error === true){
$.messager.alert('Server Error',data.message,'error');
errorCallback(data);
return false;
} else {
if (showSavemsg) {
$.messager.show({
title:'Message',
msg:'<span class="icon-ok"><img src="img/blank.gif" width="22" height="16"></span><span>Data successfully saved.</span>'
});
}
successCallback(data);
}
}
 
});
</script>
</body>
</html>

PHP Backend code:
Code:
<?php
set_time_limit
(0);
$uploadpath=(string)filter_input(INPUT_POST'uploadpath');
$response = array();
$result = array();

function 
exit_with_error ($msg) {
    
$response = array();
    
$response["error"] = true;
    
$response["message"] = $msg;
    echo 
json_encode($response,JSON_HEX_TAG);
    die;
}

function 
codeToMessage($code) { 
    switch (
$code) { 
        case 
UPLOAD_ERR_INI_SIZE
            
$message "File too big. Check \"upload_max_filesize\" in php.ini."
            break; 
        case 
UPLOAD_ERR_FORM_SIZE
            
$message "File too big. Check \"MAX_FILE_SIZE\" specified on HTML form.";
            break; 
        case 
UPLOAD_ERR_PARTIAL
            
$message "File partially uploaded."
            break; 
        case 
UPLOAD_ERR_NO_FILE
            
$message "File not uploaded."
            break; 
        case 
UPLOAD_ERR_NO_TMP_DIR
            
$message "Temporary folder not availaible."
            break; 
        case 
UPLOAD_ERR_CANT_WRITE
            
$message "Write error on file-system."
            break; 
        case 
UPLOAD_ERR_EXTENSION
            
$message "Upload blocked by extension."
            break; 

        default: 
            
$message "General error."
            break; 
    } 
    return 
$message
}

set_error_handler(function ($errno$errstr$errfile$errline ,array $errcontex) {
    throw new 
ErrorException($errstr0$errno$errfile$errline);
});
try {
// if single file
    
if(!is_array($_FILES["userfile"]["name"])) { 
        if (
$_FILES["userfile"]["error"] === UPLOAD_ERR_OK) {
            
$fileName $_FILES["userfile"]["name"];
            if (!
move_uploaded_file($_FILES["userfile"]["tmp_name"],$uploadpath.DIRECTORY_SEPARATOR.$fileName)) {
                
$msg="Upload not completed.<br />Error on copy file \"".$fileName."\" in folder \"".$uploadpath."\"";
                
exit_with_error($msg);
            }
        }
        else {
            
$upldmsg codeToMessage($_FILES["userfile"]["error"]);
            
$msg "Upload not completed.<br />\"".$_FILES["userfile"]["name"]."\" : ".$upldmsg;
            
exit_with_error($msg);
        }
    }
//else if Multiple files
    
else { 
        
$fileCount count($_FILES["userfile"]["name"]);
        for(
$i=0$i $fileCount$i++) {
            if (
$_FILES["userfile"]["error"][$i] === UPLOAD_ERR_OK) {
                
$fileName $_FILES["userfile"]["name"][$i];
                if (!
move_uploaded_file($_FILES["userfile"]["tmp_name"][$i],$uploadpath.DIRECTORY_SEPARATOR.$fileName)) {
                    
$msg="Upload not completed.<br />Error on copy file \"".$fileName."\" in folder \"".$uploadpath."\"";
                    
exit_with_error($msg);
                }
            }
            else {
                
$upldmsg codeToMessage($_FILES["userfile"]["error"][$i]);
                
$msg "Upload not completed.<br />\"".$_FILES["userfile"]["name"][$i]."\" : ".$upldmsg;
                
exit_with_error($msg);
            }
        }

    }
} catch (
ErrorException $e) {
    
$response["error"] = true;
    
$msg "ERROR: Upload not completed.<br /><br /><br/><b>URL:</b> ".$_SERVER['PHP_SELF']."<br />"
            
"<b>Error on line n. :</b> ".$e->getLine()."<br/><b>MESSAGE:</b><br />";
    
$response["message"] = $msg.$e->getMessage();
    echo 
json_encode($response,JSON_HEX_TAG);
    die;    
}

$response["error"] = false;
echo 
json_encode($response);

?>

13  General Category / EasyUI for jQuery / Re: Extension texteditor in form on: November 16, 2017, 07:15:10 AM
Thanks for answer, I know that to put a value in a texteditor I must use setValue, but when a texteditor is inside a form, and DATA is a json with all fields from form, the method .form('load',DATA) fulfill all fields but not fields with texteditor.

When you define your form, you could automatically call setValue on load success event. Like this:
Code:
$('#myform').form({
        onLoadSuccess: function (data) {
                $('#te').texteditor('setValue',data.fieldName);
        }
});
14  General Category / General Discussion / Mobile documentation and reference on: August 04, 2017, 01:52:58 AM
I'm a fan of EasyUI framework for desktop based web application. Learning EasyUI its'not so difficult thanks to well written on-line documentation and examples. Unfortunately I don't think so for mobile version learning stage.
Ok, we have examples on Demo pages, but it's absolutely insufficient. We should be find specific reference for mobile css classes and plugins. It's hard only with some examples.
Any plans to pubblish more consistent documentation about mobile? 
15  General Category / General Discussion / Re: Could you add an new plugin to upload file? on: June 20, 2017, 05:37:01 AM
If it can help you, this is how I'm using "upload file" plugin:
Code:
<div style="width: 300px;">
<form enctype="multipart/form-data" id="id-ff" name="id-ff" method="post">
<table border="0" style="width:100%">
<tr>
<td><input id="id-fb" name="userfile[]" type="text" style="width: 100%;"></td>
<td style="width: 90px; text-align: right;"><a id="id-btn-upload" href="javascript:void(0)">Upload</a></td>
</tr>
</table>
</form>
</div>
<div id="multi-purpose"></div>
<script type="text/javascript">
$(function() {
// Show a progress bar on modal window
function progressFile(method,val){
var div_id='win-progress-file';
var progress_id='progress-file';
var contenthtml = '<div id="'+progress_id+'" class="easyui-progressbar" style="width:100%;"></div>' +
'<div style="margin-top: 10px; text-align: center; font-size: 1.3em; font-weight: bold;">Uploading files</div>';
var op = method.toLowerCase();
switch (op) {
case 'show':
$("#multi-purpose").append('<div id="'+div_id+'" style="padding: 20px;"></div>');
$("#"+div_id).window({
title: 'Wait please ...',
width: 300,
resizable: false, shadow: false,
minimizable: false, maximizable: false, collapsible:false, closable: false,
modal: true,
onClose: function (event, ui) {
$("#"+div_id).window('destroy');
$("#"+div_id).remove();
},
content: contenthtml
});
break;
case 'close':
$("#"+div_id).window('close');
break;
case 'update':
$("#"+progress_id).progressbar('setValue', val);
break;

}
}

    // upload function (submit form)
    function upLoad() {
        if ($('#id-fb').textbox('getValue').length === 0) {
            $.messager.alert('Message','No files selected for upload.','error');
            return false;
        }
        $('#id-ff').form('submit', {
            url: 'manage-uploaded-files.php', //What do you want to do with files uploaded on server?
            iframe: false,
            onProgress: function (percent) {
                progressFile('update',percent);
            },
            onSubmit: function(param) {
                progressFile('show');
            },
            success: function(data){
                $('#id-ff').form('clear');
$.messager.alert('Message','Files uploaded.','info');
}
        });
    }

$('#id-fb').filebox({
buttonText: 'Browse...',
multiple: true,
icons:[{
iconCls:'icon-clear',
handler: function(e){
$(e.data.target).filebox('clear');
}
}],
onChange: function (newValue, oldValue) {
if ($(this).textbox('getValue').length > 0 ) {
$('#id-btn-upload').linkbutton('enable');
}
else { $('#id-btn-upload').linkbutton('disable'); }
}
});
$('#id-btn-upload').linkbutton({
iconCls: 'icon-upload', disabled: true, plain: true,
onClick: function() { upLoad(); }
});
$('#id-ff').form();
}
</script>
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!