dhtmlx scheduler and Ruby (ROR) customizations

was interested in implementing additional functionality to the ROR platform:

  1. Customized aggenda view with tab. I can get a tab going, but it does not produce the aggenda view when I use a construct similar to that outside of ROR after including the javascript.

  2. Customized unit views attempts fails to render but works outside ROR.

  3. Customized attempt to produce a ligthbox with addtional data entry fields also is problematic. This also fails to render.

  4. I attempted to port a basic version to Rails 3 platform, and this fails to work.

Sorry for all the questions. Any help you can give would be appreciated.

(Sorry I reposted as I accidentally had the wrong subject line. Please consolidate threads for me.)

Thanks,
kaval

(1) - (3) must not be related to ruby, as it is a fully client side functionality - be sure that related js files are really included

do you have any kind of sample of demo link?
Basically all features which are working in standalone version must work with Rails as well.

I attempted to port a basic version to Rails 3 platform
As far as I know Rails 3 was not officially released, am i wrong?

Let me work on 1-3 for a bit independently. Then I may repost. As far as rails 3 goes, you are correct, it has not yet been released, and I will not plan on using it. It did seem to have a “bundler” feature that was nice.

I was able to get the units view, and aggenda tab working. I notice there was another post pertaining to the aggenda tab showing without a name on the tab. I think using the correct javascript for the agenda extension was the solution.

Now I am having trouble mapping the different units views to the create_events.rb file prior to a db migration I think. I get Error type: LoadXML. This is my .rb file:

class CreateEvents < ActiveRecord::Migration
def self.up
create_table :events do |t|
t.column :title, :string
t.column :start, :datetime
t.column :end, :datetime
t.column :details, :string
t.column :section_id, :string
t.column :section_id1, :string
t.column :section_id2, :string
end
end
def self.down
drop_table :events
end
end

And here is my custom lightbox

{name:“description”, height:50, map_to:“text”, type:“textarea”, focus:true},
{name:“notes”, height:100, type:“textarea” , focus:true, map_to:“details” },
{name:“status”, height:23, type:“select”, options:sections, map_to:“section_id” },
{name:“loc”, height:23, type:“select”, options:sections1, map_to:“section_id1” },
{name:“rad”, height:23, type:“select”, options:sections2, map_to:“section_id2” },
{name:“time”, height:72, type:“time”, map_to:"auto

addition to above noteL Here is the events controller I am trying. I can see on the console that the parameters appear correct, but still get an XML error, and when I drag an item from one area to another, the console does not appear to note any activity.

class EventsController < ApplicationController

    before_filter :require_user
    def index
        
        render :layout => false
    end
     
    def records
        @records = Event.all
        render :layout => false
    end
    

    def dbaction
        #called for all db actions
        text = params["text"]
        start_date = params["start_date"]
        end_date = params["end_date"]
                details = params["details"]
                section_id = params["section_id"]
                section_id1 = params["section_id1"]
                section_id2 = params["section_id2"]        
        
        @mode = params["!nativeeditor_status"]
        @id = params["id"]
        @tid = @id
        
        case @mode
            when "inserted"
                n_rec = Event.new
                n_rec.title = text
                n_rec.start = start_date
                n_rec.end = end_date
                                n_rec.details = details
                                n_rec.section_id = section_id
                                n_rec.section_id1 = section_id1
                                n_rec.section_id2 = section_id2
                n_rec.save!            
                @tid = n_rec.id
            when "deleted"
                n_rec=Event.find(@id)
                  n_rec.destroy
            when "updated"
                n_rec=Event.find(@id)
                n_rec.title = text
                n_rec.start = start_date
                n_rec.end = end_date
                                n_rec.details = details
                                n_rec.section_id = section_id
                                n_rec.section_id1 = section_id1
                                n_rec.section_id2 = section_id2
                n_rec.save!
        end
    end
    
end

Code looks correctly to me
Are you using the same views for xml rendering as in existing ruby sample ?
( the one , for data loading, need to be updated with new fields )

Try to use dhtmlxscheduler_debug and check what is shown in server response after insert action.

Thanks, I forgot about that: I did add the additional entries to the file records.rxml :

xml.instruct! :angry:ml, :version=>“1.0”

xml.tag!(“data”) do #actual count of records need to be used here

@records.each do |record|

	xml.tag!("event",{ "id" => record.id }) do

		xml.tag!("text", record.title)

		xml.tag!("start_date", record.start)

		xml.tag!("end_date", record.end)

                    xml.tag!("details", record.details)                 

                    xml.tag!("section_id", record.section_id)

                    xml.tag!("section_id1", record.section_id1)

                    xml.tag!("section_id2", record.section_id2)

I still get a load XML error. The server console says:Processing EventsController#dbaction (for 127.0.0.1 at 2010-07-09 11:03:18) [POST]
Parameters: {“start_date”=>“2010-07-08 12:00”, “!nativeeditor_status”=>“inserted”, “details”=>“notes field”, “section_id”=>“rescheduled”, “action”=>“dbaction”, “editing”=>“true”, “text”=>“description field”, “id”=>“1278698561737”, “controller”=>“events”, “section_id1”=>“room B”, “end_date”=>“2010-07-08 16:00”, “section_id2”=>“unassigned”}
User Load (0.3ms) SELECT * FROM “users” WHERE (“users”.“id” = ‘1’) LIMIT 1

NoMethodError (undefined method details=' for #<Event:0xb57ef440>): app/controllers/events_controller.rb:35:indbaction’

additional note:

Line 35 of the error occurs in events_controller.rb
where an attempt is made to execute: n_rec.details = details

Any help? I am still having trouble with a NoMethodError in the dbaction script. Thanks,

Such error can occur if “Event” model has not such field as “details”, I’m not quite sure how it can occurs.