Orders management sample

Develop and Deploy Native Apps for Windows, OS X, Linux, Unix ...
Post Reply
tomy300
Posts: 70
Joined: Sat Nov 09, 2013 12:27 am

Orders management sample

Post by tomy300 »

Hi developper,

I look at your example Order management and I would like to know how it build the grid header ? it's on the fly ? the same grid object is reuse everywhere
but if it use the name from the db header how can it make the name apear correcly because the db header does't match the grid header.

if it build the grid header on the fly how to ajust the width of the header uppon the text lengh, in your example it seem that the size is not set.

I look at the GridEditor.js but does't see anything it is _buildROws function ?
vbnet code
xui.ComFactory.newCom("App.GridEditor", function(){
                ns.mainPane.append(this);
            }, threadid, {
                objectName:'customers',
                objectForm:'App.customer'
            });

support
Posts: 356
Joined: Sat Apr 27, 2013 9:22 am

Re: Orders management sample

Post by support »

You can use setHeader to refresh the whole grid.

And the Orders management App is open source.

tomy300
Posts: 70
Joined: Sat Nov 09, 2013 12:27 am

Re: Orders management sample

Post by tomy300 »

Hi, thanks

I install it on my server and insert the .sql file, all seem to work but I can't delete order

error message : OrderID must be specified! at /home/system1/public_html/apps/samples/orders/phpLinb/linb.php(375)

I tried the same sample on crossui example page and I got the same error.

also I can't delete product , popup message said can't delete top 10 records. it is because the product is link to an order in database ?

thanks

support
Posts: 356
Joined: Sat Apr 27, 2013 9:22 am

Re: Orders management sample

Post by support »

Can you modify those php files?

Those are avoid online users deleting data. You can modify php file to correct that.

in order.php, line 168

"'OrderID' => NULL" => 'ids' => NULL


and remove all lines with "$protectArray" in all php files.

tomy300
Posts: 70
Joined: Sat Nov 09, 2013 12:27 am

Re: Orders management sample

Post by tomy300 »

Hi

in the file order.js at the line 168 in crossui rad here what I have...

host.ctl_pane21.append((new xui.UI.SLabel())
.setHost(host,"ctl_slabel51")
.setLeft(10)
.setTop(14)
.setCaption("Méthode de paiement")
);

at line 71 here what I got

host.ctl_block159.append((new xui.UI.Input())
.setHost(host,"ctl_input41")
.setDataBinder("databinder")
.setDataField("OrderID")
.setReadonly(false) <------- I change it to false
.setLeft(600)
.setTop(10)
.setWidth(50)
);




and in the php file for $protectArray

I comment these line php code
//$protectArray=array(1,2,3,4,5,6,7,8,9,10);  

//do I need to comment also those line ???
          case 'delete':
                //must have parameters
                LINB::checkArgs($hash, array(
                    'array' => array(
                        'ids' => NULL
                    )
                ));
                $hasprotected=array_intersect($hash->ids, $protectArray);
                if(count($hasprotected)>0){
                    return array("warn"=>"You can't delete the top 10 records! :)");
                }else{
                    $instr = implode(",", $hash->ids);
                    return $db->delete("tbl_products", "`ProductID` in(".$instr.")");
                }

tomy300
Posts: 70
Joined: Sat Nov 09, 2013 12:27 am

Re: Orders management sample

Post by tomy300 »

Hi again,

I were able to fix and remove all $protectArray releated on every php file,

the only thing that I still have problem is that I can't remove orders in the main page, here the message.

same message OrderID must be specified! at /home/system1/public_html/apps/samples/orders/phpLinb/linb.php(375)

the delete button in toolbar is in the file GridEditor.js and not order.js , I fallow the line and tried to debug it but I don't have any clue why it wont delete.

I also see a bug in "shipping date" if I want to edit the date on double click, it change in the grid but not in the DB because if I hit refresh, the date disapear on the grid.


thanks for you great support.

support
Posts: 356
Joined: Sat Apr 27, 2013 9:22 am

Re: Orders management sample

Post by support »

line 166~170
php code
LINB::checkArgs($hash, array(
                    'array' => array(
                        'ids' => NULL
                    )
                 ));
You can fix those 'bugs' if you are familar with php.

tomy300
Posts: 70
Joined: Sat Nov 09, 2013 12:27 am

Re: Orders management sample

Post by tomy300 »

Hi,

thanks a lot it's work now.

I know php, but I have some difficulty debuging other programmer's code sometime......

Post Reply