EasyUI Forum
September 14, 2025, 03:37:46 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Rendering UI from a JSON message, editing, then POSTing the new JSON.  (Read 9122 times)
dacracot
Newbie
*
Posts: 6


View Profile
« on: December 24, 2015, 10:14:51 AM »

My team is in the early stages of a new workflow oriented web application.  A major requirement is being able to render a form based upon a JSON message from the database. Basically, the database reports what data it wants (or perhaps already has) and is asking for edits. The UI framework needs to render the form with preexisting data if it is there and then produce the JSON back with the edits. The exact form of the JSON message has yet to be established, so it can "advise" the UI renderer of the component which would be appropriate.

I really like the way EasyUI does not push some passive aggressive architecture for handling this type of workflow.  I can think of ways to code from the JSON to the UI, but the reverse is not so clear.

Any help would be greatly appreciated.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: December 25, 2015, 01:28:12 AM »

If you render all the UI components in a form, you can call 'serialize' method to get the serialized value or call 'submit' method to post the form.
Code:
$('#ff').form('submit');
You also can attach the 'onChange' event on the form to listen to what component's value is changed.
Code:
$('#ff').form({
onChange: function(target){
console.log(target)
}
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!