hrmm… I havent experienced that particularly. I just tested it on a local instance with the latest version and I was able to set default_values that worked.
I did notice a weirdness. Usually as soon as you edit the “new” row, it will fill in all the default values at once. However if you edit the column with a default value in it first. It replaces the value typed in with the default value. I didn’t see it clearing anything, but maybe its related. Anyway, thank you for your comment as it uncovered a bug.
Cheers,
Russ
Maybe the real issue is that a new row is not created, so what edited flushes away
So when you type into the “new row” at the end of the page, it immediately adds a new “new-row” just below it. That is so you could add multiple rows at once (not super recommended anyway, but… ). This shouldn’t disrupt the original new row you were editing. Perhaps, that older new-row is resorted weird?
When ‘default_values’ is set no new row is created when you start to edit the last blank row
Anyway for on of my needs (add the current username to a field) I added a new argument to the plugin code: $current_user_column (on class DBTableEditor)
and after the no_edit_cols check “if($no_edit_cols){“, the following code to add the current username in that hidden field:
$current_user = $cur->current_user_column;
if(is_string($current_user)) $current_user=explode(‘,’,$current_user);
if($current_user){
foreach($current_user as $c_user){
$wp_current_user = wp_get_current_user();
$up[$c_user] = $wp_current_user->display_name;
}
}
-
This reply was modified 5 years, 8 months ago by
kentauron.
There was an error in writing the arg, no bug.
‘default_values’ arg works fine
Thanks for updating this issue, glad you got it fixed.