| View previous topic :: View next topic |
| Author |
Message |
Laufwerk Senior

Joined: 27 Mar 2008 Posts: 53 :
Items
|
Posted: Mon Jun 02, 2008 10:16 am Post subject: Prioritys Rows |
|
|
Hi !!
I think that this is a very well option, that the user can dragging a row to up or down, and automacatly the grid save this position in a colum proirity
Bye!!! |
|
| Back to top |
|
 |
zewa666 Site Moderator


Joined: 01 Feb 2007 Posts: 606 :
Items
|
Posted: Tue Jun 03, 2008 11:23 am Post subject: |
|
|
you could do this by your own very easily...
Create a table with a column lets say called "Priority" which is unsigned int and indexed.
now you could build for Datagrid either 2 multifunctions which are beneath the grid and to be accessed for the choosen rows, or you insert virtual fields, which will do a function UP or DOWN.
Catching the move event you know what to do ... reindex the Priority column should be all.
Greetings
Zewa |
|
| Back to top |
|
 |
Laufwerk Senior

Joined: 27 Mar 2008 Posts: 53 :
Items
|
Posted: Wed Jun 04, 2008 7:35 am Post subject: |
|
|
I don't know to do it, sorry.
Please help me!!! |
|
| Back to top |
|
 |
zewa666 Site Moderator


Joined: 01 Feb 2007 Posts: 606 :
Items
|
Posted: Wed Jun 04, 2008 11:56 am Post subject: |
|
|
ill try doing such a small example this weekend...
Greetings
Zewa |
|
| Back to top |
|
 |
Laufwerk Senior

Joined: 27 Mar 2008 Posts: 53 :
Items
|
Posted: Wed Jun 04, 2008 12:26 pm Post subject: |
|
|
| perfect!!! Thanks!!! |
|
| Back to top |
|
 |
zewa666 Site Moderator


Joined: 01 Feb 2007 Posts: 606 :
Items
|
Posted: Thu Jun 05, 2008 3:27 pm Post subject: |
|
|
ok the first part for preparing the things in Datagrid is done ...
as you can see down in the example at the End i prepared a function called resort, which will be used to reindex the field colindex of each row.
Right now Im still searching for the proper algorithm, which I had ones, but due to my chaos I cant find right now
here is a code_template which you could use for it:
http://zewa.ze.funpic.de/datagrid/code_template.rar
I made a database called test, with a table called test and some testing values ...
| Code: |
CREATE TABLE IF NOT EXISTS `test` (
`id` int(11) NOT NULL auto_increment,
`colindex` int(11) NOT NULL,
`test` varchar(200) NOT NULL,
PRIMARY KEY (`id`),
KEY `colindex` (`colindex`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
--
-- Daten für Tabelle `test`
--
INSERT INTO `test` (`id`, `colindex`, `test`) VALUES
(1, 1, '1998'),
(2, 2, 'datagrid'),
(3, 3, 'zewa'),
(4, 4, 'leumas'),
(5, 5, 'php');
|
Greetings
Zewa |
|
| Back to top |
|
 |
Laufwerk Senior

Joined: 27 Mar 2008 Posts: 53 :
Items
|
Posted: Mon Jun 09, 2008 9:42 am Post subject: |
|
|
hi zewa666
It's is possible to insert this function in a new column?
on the left of delete header_name = priority (For example) and the content [image up][imagedown] for every cell ?
I believe that like this people see much clearer |
|
| Back to top |
|
 |
| |
|