EasyUI Forum
November 04, 2025, 08:55:06 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Re: Form - REST Client (POST,PUT,DELETE,GET) on: December 30, 2013, 03:26:24 AM
Hi,
Thank you.
How to modify example above to send REST "PUT" and "DELETE" to modify and delete record (not POST) ?

Darek
2  General Category / EasyUI for jQuery / Form - REST Client (POST,PUT,DELETE,GET) on: December 29, 2013, 05:23:44 AM
Hello Guys,

First, i would like to thank you for great job. EasyUI is very usefull and complex.
I would like to ask about implementation of classical REST Client in EasyUI, similar to simple REST Client in jQuery like below. How to implement it in EasyUI
I have simple form with input "name" and "id" and butto Save:

Code:

/* Form with *Save* button */

$('#btnSave').click(function() {
if ($('#PersonId').val() == '')
addPerson();
else
updatePerson();
return false;
});


after click btnSave all form's data are serialized with function:

Code:

/ * Helper function to serialize all the form fields into a JSON string */

function formToJSON() {
return JSON.stringify({
"id": $('#personId').val(),
"name": $('#name').val(),
});
}


... and than Form's data are updated by function "updatePerson" like below:

Code:

/* root url for REST server */
var rootURL = http://localhost/api/person;

/* value of person's name which should be updated with PUT methot
var personId = $('#personId').val();

function updatePerson() {
console.log('updatePerson');
$.ajax({
type: 'PUT',
contentType: 'application/json',
url: rootURL + '/' + personId,   /* PUT generate update REST url like http://localhost/api/person/2 (update person id=2)
dataType: "json",
data: formToJSON(),
success: function(data, textStatus, jqXHR){
alert('Person updated successfully');
},
error: function(jqXHR, textStatus, errorThrown){
alert('updatePerson error: ' + textStatus);
}
});



Question: How to do it with Form in EasyUI? How to implement REST client like above?
Thank you

Darek
3  General Category / EasyUI for jQuery / Re: Locale and translation for EasyUI on: December 28, 2013, 07:03:44 AM
Hi,

Thanks for answer.
Short FAQ how i used it:


1. Set locales in <head> with additional id="script-lang"

Code:
<head>
...
  <script id="script-lang" type="text/javascript" src="lib/jqueryui/lang/easyui-lang-pl.js"></script>
...
</head>


2. Created <select> with lang like this:

Code:
 
         Lang: <select id="combo-lang" class="easyui-combobox"
            data-options="
                onSelect: function(id) {
                    lang = id.value;
                    var link = $('head').find('#script-lang');
                    link.attr('src', 'lib/jqueryui/locale/easyui-lang-'+lang+'.js');
                    /* just for debug */
                    $.messager.show({
                        title:'Locale',
                        msg:'link to locale: '+link.attr('src'),
                        showType:'slide'
                    });
                },
                ediable: false
            ">
            <option value="pl" selected>Polski</option>
            <option value="de">Deutch</option>
            <option value="en">English</option>
            <option value="es">Espaniole</option>
            <option value="fr">Francais</option>
         </select>



3. cp all locale files to path lib/jqueryui/locale/

I hope that example will be useful.

Darek
4  General Category / EasyUI for jQuery / Locale and translation for EasyUI on: December 27, 2013, 05:57:04 AM
Hello Colleagues,

What is the easy way to translate EasyUI message, column names etc in wjole project? I would like to create simple combo like for theme changing, with languages and set default lang.

Thank you for the answers.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!