cwUi : Create message changed 'value' field to 'children'.
This commit is contained in:
parent
938e8c284d
commit
1a11282915
2
cwUi.cpp
2
cwUi.cpp
@ -157,7 +157,7 @@ namespace cw
|
||||
|
||||
newEle = _createEle( p, parentEle, appId, jsId );
|
||||
|
||||
unsigned i = snprintf( buf, bufN, "{ \"op\":\"create\", \"parent\":\"%s\", \"value\":{ \"%s\":{ \"jsId\":\"%s\", \"appId\":%i, \"uuId\":%i, \"class\":\"%s\", \"title\":\"%s\" ", parentJsId, eleTypeStr, jsId, appId, newEle->uuId, clas, title );
|
||||
unsigned i = snprintf( buf, bufN, "{ \"op\":\"create\", \"parent\":\"%s\", \"children\":{ \"%s\":{ \"jsId\":\"%s\", \"appId\":%i, \"uuId\":%i, \"class\":\"%s\", \"title\":\"%s\" ", parentJsId, eleTypeStr, jsId, appId, newEle->uuId, clas, title );
|
||||
|
||||
i = format_attributes(buf, bufN, i, std::forward<ARGS>(args)...);
|
||||
|
||||
|
@ -484,7 +484,7 @@ function ws_on_msg( jsonMsg )
|
||||
switch( d.op )
|
||||
{
|
||||
case 'create':
|
||||
for (const ele_type in d.value)
|
||||
for (const ele_type in d.children)
|
||||
{
|
||||
ui_create( d.parent, ele_type, d.value[ele_type] )
|
||||
//console.log(`${ele_type}: ${d.value[ele_type]}`);
|
||||
|
@ -1,12 +1,14 @@
|
||||
|
||||
{
|
||||
div: {
|
||||
|
||||
title:"My panel",
|
||||
|
||||
children: {
|
||||
|
||||
button:{ id:myBtnId, title:"Push Me" },
|
||||
select:{ id:mySelectId, title:"Selector", optionL: { myId0:"Option 0", myId2:"Option 1", myId3:"Option 3" }}
|
||||
check:{ id:myCheckId, title:"Check Me" },
|
||||
select:{ id:mySelectId, title:"Selector", values: [ myId0:"Option 0", myId2:"Option 1", myId3:"Option 3" ] }
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user