$table_list = new Table(); $table_list->setColumnsStyle("86dip;100%"); //Controls in grid. $image = new InputImage(); $image->setClass("image.List"); $name = new InputText(); $name->setClass("input.title"); $address = new InputText(); $table_info = new Table(); $table_info->addControl($name, 1, 1, 1, 1, "Left", "Bottom"); $table_info->addControl($address, 2, 1); $table_list->addControl($image, 1, 1); $table_list->addControl($table_info, 1, 2); $list->addData(load_companies()); $list->addSearch($name); $list->addControl($table_list, 1, 1); $list->onTap(action()); $canvas->addPosition($list, "0", "100%", "0", "100%", "0", "0", 0); $canvas->addPosition($img_add, "100%", "60dip", "97%", "60dip", "15dip", "3%", 1); $mainTable->addControl($canvas, 1, 1); $win->addControl($mainTable); function load_companies() { $url = "http://demo.kikapptools.com/CRMManager/crud/getCompanies.php"; $httpClient = new httpClient(); $result = $httpClient->Execute('GET', $url); $struct = array(array("CompanyId" => DataType::Numeric(8), "CompanyName" => DataType::Character(100), "CompanyImage" => DataType::Character(200), "CompanyAddress" => DataType::Character(200))); Data::FromJson($struct, $result); $id = new InputNumeric(); foreach ($struct as $company) { $id = $company['CompanyId'];
$name = new InputText(); $name->setClass("input.Title"); $date = new InputDate(); $date->setClass("input.Common"); $statusIcon = new Image(); $statusIcon->setImage("img/tick.png"); $statusIcon->setClass("image.ListIcon"); $statusIcon->onTap(changeToDone()); $table_list = new Table(); $table_list->addControl($name, 1, 1, 1, 6, "Left", "Middle"); $table_list->addControl($date, 1, 2, 1, 2, "Left", "Middle"); $table_list->addControl($statusIcon, 1, 3, 1, 1, "Middle", "Middle"); $table_grid->addControl($table_list, 1, 1); $table_grid->onTap(detail()); //Add controls to main screen $list->addControl($table_grid); $table->addControl($list); $win->addControl($table); $win->Render(); function load_grid() { //Make JSON request $url = "http://demo.kikapptools.com/taskManager/crud/getTask.php?status=" . $statusList . "&period=" . $period; $httpClient = new httpClient(); $result = $httpClient->Execute('GET', $url); //Cast response data type $struct = array(array("id" => DataType::Numeric(6), "task" => DataType::Character(150), "status" => DataType::Numeric(1), "created_at" => DataType::Character(20))); Data::FromJson($struct, $result); //Add result to screen vars foreach ($struct as $items) { $id = $items['id'];
$title->setAutoGrow(true); $image = new InputImage(); $image->setClass("image.roundedListImage"); $desc = new InputText(300); $desc->setClass("input.textDescription"); $price = new InputText(10); $price->setClass("input.priceList"); $table_desc = new Table(); $table_desc->setRowsStyle("25dip;35dip;25dip"); $table_desc->setClass("tableProduct"); $table_desc->addControl($title, 1, 1); $table_desc->addControl($desc, 2, 1); $table_desc->addControl($price, 3, 1); $table_grid->addControl($image, 1, 1); $table_grid->addControl($table_desc, 1, 2); $grid->addControl($table_grid); $table->addControl($grid); $win->addControl($table); $win->Render(); function changeView() { $win->Open("ProductThumbList", $cat); } //Grid load function function grid_load() { $url = "http://demo.kikapptools.com/magento/apiKikApp/Products.php?cId=" . $cat; $httpClient = new httpClient(); $result = $httpClient->Execute('GET', $url); $struct = array(array("id" => DataType::Numeric(6), "name" => DataType::Character(150), "description" => DataType::Character(300), "pirce" => DataType::Character(10), "thumb" => DataType::Character(200), "stock" => DataType::Character(50), "href" => DataType::Character(300))); Data::FromJson($struct, $result);
$title_prod->setAutoGrow(true); $image_prod = new InputImage(); $image_prod->setClass("imageImageList2"); $desc_prod = new InputText(300); $desc_prod->setClass("attributeTextGray"); $price_prod = new InputText(10); $price_prod->setClass("attributeTextPrice"); $table_desc_prod = new Table(); $table_desc_prod->setRowsStyle("25dip;35dip;25dip"); $table_desc_prod->setClass("tableProduct"); $table_desc_prod->addControl($title_prod, 1, 1); $table_desc_prod->addControl($desc_prod, 2, 1); $table_desc_prod->addControl($price_prod, 3, 1); $table_grid_product->addControl($image_prod, 1, 1); $table_grid_product->addControl($table_desc_prod, 1, 2); $grid->addControl($table_grid_product); $table->setRowsStyle("100%"); $table->addControl($grid, 1, 1); $win->addControl($table); function action_prod() { $win->Open("product_detail", $id_prod, $title_prod, $desc_prod, $price_prod); } function grid_load_products() { $url_prod = "http://www.demo.kikapptools.com/magento/apiGecko/productos.php?cId=0"; //the server url //Remember to configurate your server url on the Manifest.xml on <services> $httpClient_prod = new httpClient(); $result_prod = $httpClient_prod->Execute('GET', $url_prod); //you get a JSON
*/ $win = new SDPanel(); $win->setCaption("Categories"); $table = new Table(); $list = new Grid(); $list->addData(load_grid()); $list->setEmptyGridText("No items available"); $list->onTap(action()); $id = new InputNumeric(); $name = new InputText(); $name->setClass("input.categories"); $table_list = new Table(); $table_list->setHeight("60dip"); $table_list->setClass("table.categorias"); $table_list->addControl($name, 1, 1, 1, 1, "Left", "Middle"); $list->addControl($table_list, 1, 1, 1, 1, "Left", "Middle"); $table->addControl($list, 1, 1); $win->addControl($table); $win->Render(); function action() { $win->Open("SubCategories", $id, $name); } function load_grid() { $url = "http://demo.kikapptools.com/magento/apiKikApp/Categories.php"; $httpClient = new httpClient(); $result = $httpClient->Execute('GET', $url); $struct = array(array("id" => DataType::Numeric(6), "name" => DataType::Character(150))); Data::FromJson($struct, $result); foreach ($struct as $product) {