crudkit icon indicating copy to clipboard operation
crudkit copied to clipboard

RESOLVED: Summary not working

Open masterhelper0 opened this issue 9 years ago • 2 comments

require "vendor/autoload.php"; use CrudKit\CrudKitApp; use CrudKit\Pages\MySQLTablePage;

// Create a new app $app = new CrudKitApp();

// Create a new page mapped to a table $sqlPage = new MySQLTablePage ("flat", "root", "0101", "radamira", array('charset'=>'utf8'));

$sqlPage->setTableName ("flat")

    ->setName ("Квартиры")
    ->setPrimaryColumn ("id")

    ->addColumn ("url", "Адрес страницы")
    ->addColumn ("name", "Название")
    ->addColumn ("cost", "Общая Стоимость")
    ->addColumn ("kvm", "Цена 1 кв.м.")
    ->addColumn ("type", "(0 = СТУДИЯ) или (1 = однушка) или (2 = двушка) или (3 = трешка)")

    ->addColumn ("rooms", "Количество Комнат")
    ->addColumn ("merged_toilet", "Санузел совмещен (1 = ДА) или (0 = НЕТ)")

    ->addColumn ("full", "Общая кв.м.")
    ->addColumn ("live", "Жилая кв.м.")
    ->addColumn ("toilet", "Туалет кв.м.")
    ->addColumn ("kitchen", "Кухня кв.м.")
    ->addColumn ("balcony", "Балкон кв.м.")

    ->addColumn ("windows", "Окна выходят на")
    ->addColumn ("bal_lod", "(1 = Балкон) или (0 = Лоджия)")

    ->addColumn ("address_short", "Короткое название дома")
    ->addColumn ("plan", "Файл с Планировкой")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")
    // ->addColumn ("_______________", "________________")

    // ->addColumn ("Country", "Country", [ // Additional configuration using options
    //     'validation' => [
    //         'required' => false,
    //     ]
    // ])

     ->setSummaryColumns (
        ["name"],
        ["balcony"]
    );

// Add the page to the app $app->addPage($sqlPage);

// Render the app $app->render(); ?>

masterhelper0 avatar Feb 24 '16 18:02 masterhelper0

Resolved > incorrect setSummaryColumns array syntax. Should be: ->setSummaryColumns(array("name", "balcony"));

Thanks

masterhelper0 avatar Feb 24 '16 18:02 masterhelper0

Can I ask why you were using // ->addColumn ("_______________", "________________")

I'm gonna work on adding new features this week and if it's something that can help I can investigate adding it.

skyronic avatar Feb 25 '16 02:02 skyronic