actually select_id is null too and that’s the one that holds the new primary key that was added in the db
-D
actually select_id is null too and that’s the one that holds the new primary key that was added in the db
-D
Since the getState isn’t returning the select_id like it should
I’m going to try using the set_response_attribute to send it back
My boss is happy I have a save button, but so far I’m not able to add links with my new id in the lightbox as a result of the missing select_id…
-D
I created a band-aid and it’s semi working.
I’m getting the event ID in the lightbox to use as a link by getting the last id inserted into the database and passing it back through a fictitious error message and setting a localStorage variable that is accessed in the javascript for the light box (what a royal pain in the …)
Now the only problem is that there’s no return value until you press the save button 2x. You have got to be kidding Well that’s better than having to save and re-enter the lightbox. May have to create a band-aid for this too!
(on click double click lol)
-David
Notes:
scheduler.php.tpl
function init() {
localStorage.myid = '';
scheduler.attachEvent("onLightbox", function(id){
//localStorage.myid = scheduler.getState().select_id;
localStorage.myid = id;
scheduler.form_blocks["link_editor"] = {
render:function(sns) {
// get id
var id = scheduler.getState().select_id;
var readonly = (id === null) ? 0 : this.getEvent(id).readonly;
// for new records
mylength = localStorage.myid.length;
if (!id && mylength != 13) {
id = localStorage.myid;
}
// all this for this !!!
var link1 = “Pri
nt”;
return “
dp.attachEvent("onAfterUpdate", function(sid, action, tid, tag){
localStorage.myid = tag.getAttribute("event_id");
–
event_model.php (codeigniter)
–
function insert($action){
$this->db->insert(“events”, $this);
$event_id = $this->db->insert_id();
$action->success($event_id);
//$connector->render(); // case style show
$this->log($action, ‘added’, $event_id);
$action->set_response_attribute(“event_id”,$event_id);
–