editor button delet all

editor button delet all

rrzavaletarrzavaleta Posts: 78Questions: 52Answers: 2
edited December 2014 in Editor

the problem is that I need to delete using the edit button but unused field in field ID (auto-incrementing),.

CREATE TABLE IF NOT EXISTS `ing_valor_campo` (
  `ID_ASEGURADORA` int(10) NOT NULL,
  `ID_CAMPO` int(5) NOT NULL,
  `VAL_CAMPO` char(5) NOT NULL,
  `DESC_VALOR` varchar(150) NOT NULL,
  `SECUENCIA` int(4) NOT NULL,
  PRIMARY KEY (`ID_ASEGURADORA`,`ID_CAMPO`,`VAL_CAMPO`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

as I can delete and update without using a field ID.
My php is

Editor::inst( $db, 'ING_VALOR_CAMPO' )
    ->pkey('ID_ASEGURADORA','ID_CAMPO','VAL_CAMPO')  
    ->fields(           
        Field::inst( 'ID_ASEGURADORA'), 
        Field::inst( 'ID_CAMPO'),
        Field::inst( 'VAL_CAMPO'),
        Field::inst( 'DESC_VALOR'),
        Field::inst( 'SECUENCIA')       
             )
    ->where('ID_ASEGURADORA',   $idaseguradora)
    ->where('ID_CAMPO'      ,   $idcampo)           
    ->process( $_POST )
    ->json();

As I can delete a row from the database using the parameters ID_ASEGURADORA, ID_CAMPO AND VAL_CAMPO ?
also finally I mention that the fields ID_ASEGURADORA, ID_CAMPO .

also finally I mention that the content of ID_ASEGURADORA, ID_CAMPO are brought from another table and field VAL_CAMPO user is assigned.

Any ideas, or any comments.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    ->pkey('ID_ASEGURADORA','ID_CAMPO','VAL_CAMPO')

    Composite primary keys are not supported in Editor at this time - sorry. The above code will not work as you expect - only ID_ASEGURADORA would be used there.

    It sounds like you might need to make a custom Ajax call based on the information available.

    Allan

This discussion has been closed.